mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 01:10:28 +03:00
CI: Require a blank line between commit titles and bodies
This commit is contained in:
parent
14f6856d1d
commit
a8537ad096
Notes:
sideshowbarker
2024-07-17 21:11:18 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/a8537ad0964 Pull-request: https://github.com/SerenityOS/serenity/pull/11818 Reviewed-by: https://github.com/linusg ✅
4
.github/workflows/lintcommits.yml
vendored
4
.github/workflows/lintcommits.yml
vendored
@ -20,6 +20,10 @@ jobs:
|
||||
pattern: /^[^\r]*$/,
|
||||
error: "Commit message contains CRLF line breaks (only unix-style LF linebreaks are allowed)",
|
||||
},
|
||||
{
|
||||
pattern: /^.+(\r?\n(\r?\n.*)*)?$/,
|
||||
error: "Empty line between commit title and body is missing",
|
||||
},
|
||||
{
|
||||
pattern: /^.{0,72}(?:\r?\n(?:(.{0,72})|(.*?([a-z]+:\/\/)?(([a-zA-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)",
|
||||
|
@ -30,6 +30,10 @@ while read -r line; do
|
||||
((line_number += 1))
|
||||
line_length=${#line}
|
||||
|
||||
if [[ $line_number -eq 2 ]] && [[ $line_length -ne 0 ]]; then
|
||||
error "Empty line between commit title and body is missing"
|
||||
fi
|
||||
|
||||
category_pattern="^\S.*?\S: .+"
|
||||
if [[ $line_number -eq 1 ]] && (echo "$line" | grep -E -v -q "$category_pattern"); then
|
||||
error "Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)"
|
||||
|
Loading…
Reference in New Issue
Block a user