Skip to content

Commit

Permalink
Merge branch 'master' into add-async-checkpoint-flush-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Mar 8, 2022
2 parents 1332ef8 + 98522d1 commit 5ea0ab8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/check-diff-line-width.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,22 @@

set -e

git --no-pager diff master -U0 cdc pkg |
# The hash of the latest commit with a commit message matching
# the pattern `\(#[0-9]+\)$`. It's usually a master branch commit.
BASE_HASH=$(git --no-pager log -E --grep='\(#[0-9]+\)$' -n 1 --format=format:%H)

git --no-pager diff $BASE_HASH -U0 -- cdc pkg |
grep -E '^\+' | grep -vE '^\+\+\+' |
sed 's/\t/ /g' |
awk '
{
# Minus 1 for +
width = length($0) - 1;
if (width > 100) {
print "[ERROR] width too long, " length ": " $0 ;
print "\033[0;31m[ERROR]\033[0m width too long, " length ": " $0 ;
fail=1 ;
} else if (width > 80) {
print "[WARN] width too long, " length ": " $0 ;
print "\033[0;33m[WARN]\033[0m width too long, " length ": " $0 ;
}
}
END { if (fail != 0) { exit 1 } }'

0 comments on commit 5ea0ab8

Please sign in to comment.