mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Meta: Use grep -E/F, not grep -P
grep -E and -F are POSIX standard, and meets all our matching needs.
This commit is contained in:
committed by
Andreas Kling
parent
4de7b3ad24
commit
c2d44209a8
Notes:
sideshowbarker
2024-07-18 01:37:08 +09:00
Author: https://github.com/thislooksfun Commit: https://github.com/SerenityOS/serenity/commit/c2d44209a8f Pull-request: https://github.com/SerenityOS/serenity/pull/10652 Reviewed-by: https://github.com/BenWiederhake ✅
@@ -29,12 +29,12 @@ while read -r line; do
|
||||
line_length=${#line}
|
||||
|
||||
category_pattern="^\S.*?\S: .+"
|
||||
if [[ $line_number -eq 1 ]] && (echo "$line" | grep -P -v -q "$category_pattern"); then
|
||||
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)"
|
||||
fi
|
||||
|
||||
title_case_pattern="^\S.*?: [A-Z0-9]"
|
||||
if [[ $line_number -eq 1 ]] && (echo "$line" | grep -P -v -q "$title_case_pattern"); then
|
||||
if [[ $line_number -eq 1 ]] && (echo "$line" | grep -E -v -q "$title_case_pattern"); then
|
||||
error "First word of commit after the subsystem is not capitalized"
|
||||
fi
|
||||
|
||||
@@ -43,7 +43,7 @@ while read -r line; do
|
||||
fi
|
||||
|
||||
url_pattern="([a-z]+:\/\/)?(([a-zA-Z0-9_]|-)+\.)+[a-z]{2,}(:\d+)?([a-zA-Z_0-9@:%\+.~\?&\/=]|-)+"
|
||||
if [[ $line_length -gt 72 ]] && (echo "$line" | grep -P -v -q "$url_pattern"); then
|
||||
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)"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user