Meta: Allow a couple of extra characters in long URLs in commit messages
This allows the number sign (for anchors) and semi-colons.
This commit is contained in:
parent
323baf7a01
commit
3bdb79c870
2 changed files with 2 additions and 2 deletions
2
.github/workflows/lint-commits.yml
vendored
2
.github/workflows/lint-commits.yml
vendored
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
error: "Commit title ends in a period",
|
||||
},
|
||||
{
|
||||
pattern: /^(.{0,72}|\s*[a-z]+:\/\/([a-z0-9\-]+\.)+[a-z]{2,}(:\d+)?(\/[a-zA-Z_0-9@:%+.~?&=\-]+)*)$/,
|
||||
pattern: /^(.{0,72}|\s*[a-z]+:\/\/([a-z0-9\-]+\.)+[a-z]{2,}(:\d+)?(\/[a-zA-Z_0-9@#:;%+.~?&=\-]+)*)$/,
|
||||
error: "Commit message lines are too long (maximum allowed is 72 characters, except for URLs on their own line)",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ while read -r line; do
|
|||
error "Commit title ends in a period"
|
||||
fi
|
||||
|
||||
url_pattern='^\s*[a-z]+:\/\/([a-z0-9\-]+\.)+[a-z]{2,}(:\d+)?(\/[a-zA-Z_0-9@:%+.~?&=\-]+)*$'
|
||||
url_pattern='^\s*[a-z]+:\/\/([a-z0-9\-]+\.)+[a-z]{2,}(:\d+)?(\/[a-zA-Z_0-9@#:;%+.~?&=\-]+)*$'
|
||||
if [[ $line_length -gt 72 ]] && (echo "$line" | grep -E -v -q "$url_pattern"); then
|
||||
error "Commit message lines are too long (maximum allowed is 72 characters, except for URLs on their own line)"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue