Skip to content

Commit 058265c

Browse files
authored
chore: TT-130 update commit message (#254)
1 parent a012233 commit 058265c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ pre-commit install -t pre-commit -t commit-msg
167167
With this command the library will take configuration from `.pre-commit-config.yaml` and will set up the hooks by us.
168168

169169

170+
### Commit message style
171+
Use the following commit message style. e.g:
172+
```
173+
'feat: TT-123 Applying some changes'
174+
'fix: TT-321 Fixing something broken'
175+
'feat(config): TT-00 Fix something in config files'
176+
```
177+
The value `TT-###` refers to the Jira issue that is being solved. Use TT-00 if the commit does not refer to any issue.
178+
170179
### Test
171180
We are using [Pytest](https://docs.pytest.org/en/latest/index.html) for tests. The tests are located in the package
172181
`tests` and use the [conventions for python test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery).

commons/git_hooks/enforce_semantic_commit_msg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
ERROR_MSG = """
55
Commit failed!
66
Please use semantic commit message format. Examples:
7-
'feat: Applying some changes'
8-
'fix: Fixing something broken'
9-
'feat(config): Fix something in config files'
7+
'feat: TT-123 Applying some changes'
8+
'fix: TT-321 Fixing something broken'
9+
'feat(config): TT-00 Fix something in config files'
1010
1111
For more details in commit message format, review https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits
1212
"""
1313

1414
SUCCESS_MSG = "Commit succeed!. Semantic commit message is correct."
1515

16-
COMMIT_MSG_REGEX = r'(TT-)[0-9].*(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*'
16+
COMMIT_MSG_REGEX = r'(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?: TT-[0-9]+ .*'
1717

1818
# Get the commit message file
1919
commit_msg_file = open(sys.argv[1]) # The first argument is the file

0 commit comments

Comments
 (0)