|
9 | 9 | ERROR_EMPTY_MESSAGE = 'Commit message seems to be empty.'
|
10 | 10 | ERROR_MISSING_COLON = "Missing colon after 'type' or 'scope'. Ensure the commit message has the format '<type><(scope/component)>: <summary>'." # noqa: E501
|
11 | 11 | ERROR_TYPE = "Issue with 'type'. Ensure the type is one of [{}]."
|
12 |
| -ERROR_SCOPE_CAPITALIZATION = "Issue with 'scope'. Ensure the scope starts with a lowercase letter. Allowed special characters in `scope` are _ / . , * -" # noqa: E501 |
| 12 | +ERROR_SCOPE_CAPITALIZATION = "Issue with 'scope'. Ensure the 'scope' is written in lower case without whitespace. Allowed special characters in 'scope' are _ / . , * -" # noqa: E501 |
13 | 13 | ERROR_SUMMARY_LENGTH = "Issue with 'summary'. Ensure the summary is between {} and {} characters long."
|
14 | 14 | ERROR_SUMMARY_CAPITALIZATION = "Issue with 'summary'. Ensure the summary starts with an uppercase letter."
|
15 | 15 | ERROR_SUMMARY_PERIOD = "Issue with 'summary'. Ensure the summary does not end with a period."
|
@@ -50,7 +50,7 @@ def raise_error(message: str, error: str, types: str, args: argparse.Namespace)
|
50 | 50 |
|
51 | 51 | commit message rules:
|
52 | 52 | - use one of the following types: [{types}]
|
53 |
| - - 'scope/component' is optional, but if used, it must start with a lowercase letter |
| 53 | + - 'scope/component' is optional, but if used, must be written in lower case without whitespace |
54 | 54 | - 'summary' must not end with a period
|
55 | 55 | - 'summary' must be between {args.subject_min_length} and {args.subject_max_length} characters long
|
56 | 56 | - 'body' is optional, but if used, lines must be no longer than {args.body_max_line_length} characters
|
@@ -122,7 +122,7 @@ def parse_commit_message(args: argparse.Namespace, input_commit_message: str) ->
|
122 | 122 | raise_error(message_title, error, types, args)
|
123 | 123 |
|
124 | 124 | # If 'scope' is provided, check for valid 'scope'
|
125 |
| - REGEX_SCOPE = r'^[a-z][a-zA-Z0-9_/.,*-]*$' |
| 125 | + REGEX_SCOPE = r'^[a-z0-9_/.,*-]*$' |
126 | 126 | if commit_scope and not re.match(REGEX_SCOPE, commit_scope):
|
127 | 127 | raise_error(message_title, ERROR_SCOPE_CAPITALIZATION, types, args)
|
128 | 128 |
|
|
0 commit comments