Skip to content

Commit 97911f3

Browse files
adyxaxanis-campos
authored andcommitted
feat(subject): no longer prevent commit subjects from starting with a capital letter
1 parent af6ccfc commit 97911f3

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ A brief but meaningfull description of the change.
113113
Here are recommandations for writing your subject:
114114

115115
- use the imperative, present tense: "change" not "changed" nor "changes"
116-
- don't capitalize first letter
117116
- no "." (dot) at the end
118117

119118
### Body

git-commit-template

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type(scope): subject
2525
# A brief but meaningful description of the change. Here are some
2626
# recommendation for writing your subject:
2727
# - use the imperative, present tense: "change" not "changed" nor "changes"
28-
# - don't capitalize first letter
2928
# - no "." (dot) at the end
3029

3130
## Body

validator.bats

+1-6
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ BROKEN:
414414
[ "$status" -eq $ERROR_SUBJECT ]
415415
}
416416

417-
@test "subject cannot start with a capitalized letter" {
418-
run validate_subject "Plop"
419-
[ "$status" -eq $ERROR_SUBJECT ]
420-
}
421-
422417
@test "subject cannot end with a point" {
423418
run validate_subject "plop."
424419
[ "$status" -eq $ERROR_SUBJECT ]
@@ -616,7 +611,7 @@ Commit about stuff\"plop \"
616611
LUM-2345'
617612

618613
run validate "$MESSAGE"
619-
[[ "$status" -eq $ERROR_SUBJECT ]]
614+
[[ "$status" -ne $ERROR_SUBJECT ]]
620615
}
621616

622617
@test "overall validation invalid body length" {

validator.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fi
77
readonly HEADER_PATTERN="^([^\(]+)\(([^\)]+)\): (.+)$"
88
readonly TYPE_PATTERN="^(feat|fix|docs|gen|lint|refactor|test|chore)$"
99
readonly SCOPE_PATTERN="^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
10-
readonly SUBJECT_PATTERN="^([a-z0-9].*[^ ^\.])$"
10+
readonly SUBJECT_PATTERN="^([A-Za-z0-9].*[^ ^\.])$"
1111
readonly JIRA_PATTERN="[A-Z]{2,6}[0-9]{0,6}-[0-9]{1,6}"
1212
readonly JIRA_FOOTER_PATTERN="^(${JIRA_PATTERN} ?)+$"
1313
readonly JIRA_HEADER_PATTERN="^.*[^A-Z](${JIRA_PATTERN}).*$"
@@ -179,7 +179,7 @@ validate_subject() {
179179
local SUBJECT=$1
180180

181181
if [[ ! $SUBJECT =~ $SUBJECT_PATTERN ]]; then
182-
echo -e "commit subject '$SUBJECT' should start with a lower case and not end with a '.'"
182+
echo -e "commit subject '$SUBJECT' should not end with a '.'"
183183
exit $ERROR_SUBJECT
184184
fi
185185
}

0 commit comments

Comments
 (0)