Skip to content

Commit ef2d2ac

Browse files
sunshinecogitster
authored andcommitted
t/check-non-portable-shell: stop being so polite
Error messages emitted by this linting script are long and noisy, consisting of several sections: <test-script>:<line#>: error: <explanation>: <failed-shell-text> Many problem explanations ask the reader to "please" use a suggested alternative, however, such politeness is unnecessary and just adds to the noise and length of the line, so drop "please" to make the message a bit more concise. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 079b087 commit ef2d2ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/check-non-portable-shell.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ sub err {
1717
while (<>) {
1818
chomp;
1919
/\bsed\s+-i/ and err 'sed -i is not portable';
20-
/\becho\s+-[neE]/ and err 'echo with option is not portable (please use printf)';
20+
/\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)';
2121
/^\s*declare\s+/ and err 'arrays/declare not portable';
22-
/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
23-
/\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
24-
/\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable (please use test_line_count)';
25-
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
22+
/^\s*[^#]\s*which\s/ and err 'which is not portable (use type)';
23+
/\btest\s+[^=]*==/ and err '"test a == b" is not portable (use =)';
24+
/\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable (use test_line_count)';
25+
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
2626
# this resets our $. for each file
2727
close ARGV if eof;
2828
}

0 commit comments

Comments
 (0)