diff contrib/check-code.py @ 27557:28b5c4fcf48d

tests: Solaris diff -U also emits "No differences encountered" This came up before, but the tests in check-code.py don't find -U (only -u) and they don't work when the diff is inside a shell function. This fixes the offending tests and beefs up check-code.py.
author Danek Duvall <danek.duvall@oracle.com>
date Sun, 27 Dec 2015 15:24:48 -0800
parents b81b8dbecc26
children 15b06f306c1f
line wrap: on
line diff
--- a/contrib/check-code.py	Tue Dec 29 18:11:14 2015 -0500
+++ b/contrib/check-code.py	Sun Dec 27 15:24:48 2015 -0800
@@ -122,7 +122,8 @@
     (r'^( *)\t', "don't use tabs to indent"),
     (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
      "put a backslash-escaped newline after sed 'i' command"),
-    (r'^diff *-\w*u.*$\n(^  \$ |^$)', "prefix diff -u with cmp"),
+    (r'^diff *-\w*[uU].*$\n(^  \$ |^$)', "prefix diff -u/-U with cmp"),
+    (r'^\s+(if)? diff *-\w*[uU]', "prefix diff -u/-U with cmp"),
     (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
     (r'\|&', "don't use |&, use 2>&1"),