We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5691028 commit 40b17f5Copy full SHA for 40b17f5
contrib/devtools/lint-whitespace.sh
@@ -59,7 +59,7 @@ if showdiff | grep -E -q '^\+.*\s+$'; then
59
fi
60
61
# Check if tab characters were found in the diff.
62
-if showcodediff | grep -P -q '^\+.*\t'; then
+if showcodediff | perl -nle '$MATCH++ if m{^\+.*\t}; END{exit 1 unless $MATCH>0}' > /dev/null; then
63
echo "This diff appears to have added new lines with tab characters instead of spaces."
64
echo "The following changes were suspected:"
65
FILENAME=""
@@ -81,7 +81,7 @@ if showcodediff | grep -P -q '^\+.*\t'; then
81
82
echo "$line"
83
84
- done < <(showcodediff | grep -P '^(diff --git |@@|\+.*\t)')
+ done < <(showcodediff | perl -nle 'print if m{^(diff --git |@@|\+.*\t)}')
85
RET=1
86
87
0 commit comments