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:
Timothy Flynn
2026-01-10 13:38:23 -05:00
committed by Jelle Raaijmakers
parent 323baf7a01
commit 3bdb79c870
Notes: github-actions[bot] 2026-01-10 19:26:29 +00:00
2 changed files with 2 additions and 2 deletions

View File

@@ -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)",
},
{

View File

@@ -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