mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 01:10:28 +03:00
CI: Add a check to report git merge commit
This commit is contained in:
parent
f93c7fbb5e
commit
839c1a574d
Notes:
sideshowbarker
2024-07-17 03:29:13 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/839c1a574d Pull-request: https://github.com/SerenityOS/serenity/pull/16120 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg
4
.github/workflows/lintcommits.yml
vendored
4
.github/workflows/lintcommits.yml
vendored
@ -28,6 +28,10 @@ jobs:
|
||||
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)",
|
||||
},
|
||||
{
|
||||
pattern: /^Merge branch/,
|
||||
error: "Commit is a git merge commit, use the rebase command instead",
|
||||
},
|
||||
{
|
||||
pattern: /^\S.*?\S: .+/,
|
||||
error: "Missing category in commit title (if this is a fix up of a previous commit, it should be squashed)",
|
||||
|
@ -34,6 +34,11 @@ while read -r line; do
|
||||
error "Empty line between commit title and body is missing"
|
||||
fi
|
||||
|
||||
merge_commit_pattern="^Merge branch"
|
||||
if [[ $line_number -eq 1 ]] && (echo "$line" | grep -E -q "$merge_commit_pattern"); then
|
||||
error "Commit is a git merge commit, use the rebase command instead"
|
||||
fi
|
||||
|
||||
category_pattern='^(Revert "|\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