Skip to content

Commit bc89086

Browse files
chore(validator): enforce footer length
1 parent cf974b9 commit bc89086

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ See the [open issues](https://github.com/lumapps/commit-msg-validator/issues) fo
187187
- [x] list all the commit, and run validation on each
188188
- [x] enforce the overall commit message structure
189189
- [x] enforce the overall commit header structure
190-
- [x] enforce the overall commit header lenght
190+
- [x] enforce the overall commit header length
191191
- [x] enforce the commit type
192192
- [x] enforce the commit scope
193193
- [x] enforce the commit subject
194194
- [x] enforce the commit body length
195195
- [x] enforce the JIRA reference
196-
- [ ] enforce the BROKEN part
196+
- [x] enforce the BROKEN part length
197197
- [ ] avoid trailing space
198198
- [ ] allow automated revert commit
199199
- [ ] allow fixup! and squash! commit with an option

Diff for: validator.bats

+13
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,19 @@ LUM-2345'
486486
[[ "$status" -eq $ERROR_BODY_LENGTH ]]
487487
}
488488

489+
@test "overall validation invalid footer length" {
490+
MESSAGE='feat(scope1): subject
491+
492+
plop
493+
494+
LUM-2345
495+
BROKEN:
496+
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'
497+
498+
run validate "$MESSAGE"
499+
[[ "$status" -eq $ERROR_BODY_LENGTH ]]
500+
}
501+
489502
@test "overall validation missing jira" {
490503
MESSAGE='feat(scope1): subject
491504

Diff for: validator.sh

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ validate() {
224224
validate_subject "$SUBJECT"
225225

226226
validate_body_length "$BODY"
227+
validate_body_length "$FOOTER"
227228

228229
validate_jira "$TYPE" "$JIRA"
229230
}

0 commit comments

Comments
 (0)