Thread (6 messages) 6 messages, 4 authors, 2017-12-21

Re: [PATCH v2 1/1] check-non-portable-shell.pl: Quoted `wc -l` is not portable

flat view

From: Eric Sunshine <hidden>
Date: 2017-12-17 00:06:46

On Sat, Dec 16, 2017 at 2:52 PM,  [off-list ref] wrote:
quoted hunk ↗ jump to hunk
[...]
Add a check in check-non-portable-shell.pl to find '"' between
`wc -l` and '=' and hint the user about test_line_count().

Reviewed-by: Johannes Schindelin <redacted>
Signed-off-by: Torsten Bögershausen <redacted>
---
diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index 03dc9d2852..fadbb1e5a7 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -21,6 +21,7 @@ while (<>) {
        /^\s*declare\s+/ and err 'arrays/declare not portable';
        /^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
        /\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
+       /\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable, please use test_line_count';
Nit: Every other "please use" suggestion is parenthesized; for
consistency, this probably ought to be, as well.
        /\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help