Skip to content

Commit 3b08582

Browse files
encounterSean-Der
authored andcommitted
Ignore new-line in commit msg subject length check
Using a carefully crafted 50 character subject line, we can test that this lint doesn't include the newline in its calculation.
1 parent 2a4dbc6 commit 3b08582

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu
1717
* [Max Hawkins](https://github.com/maxhawkins) - *Git hooks*
1818
* [Atsushi Watanabe](https://github.com/at-wat) - *Sync files among repositories*
1919
* [Daniele Sluijters](https://github.com/daenney) - *Misc fixes*
20+
* [Luke S](https://github.com/encounter)
2021

2122
### License
2223
MIT License - see [LICENSE](LICENSE) for full text

ci/.github/lint-commit-message.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ lint_commit_message() {
3131
display_commit_message_error "$1" 'Separate subject from body with a blank line'
3232
fi
3333

34-
if [[ "$(echo "$1" | head -n1 | wc -m)" -gt 50 ]]; then
34+
if [[ "$(echo "$1" | head -n1 | awk '{print length}')" -gt 50 ]]; then
3535
display_commit_message_error "$1" 'Limit the subject line to 50 characters'
3636
fi
3737

0 commit comments

Comments
 (0)