From c2d44209a8f508ccb243410fc0e591976820b287 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Tue, 26 Oct 2021 13:08:39 -0500 Subject: Meta: Use grep -E/F, not grep -P grep -E and -F are POSIX standard, and meets all our matching needs. --- Meta/lint-commit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Meta/lint-commit.sh') diff --git a/Meta/lint-commit.sh b/Meta/lint-commit.sh index 1df284f930..b30dd9bcd0 100755 --- a/Meta/lint-commit.sh +++ b/Meta/lint-commit.sh @@ -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 -- cgit v1.2.3