diff contrib/check-code.py @ 16098:c6c9b83a1e8a stable

tests: tighten checks for octal escapes in shell printf. printf on AIX default shell ksh (89) says \1 is an invalid escape. It insists on at least 2 digits. This causes failures in test-keyword.t and test-status.t. check-code.py already looks out for \NNN and recommends using Python for outputting octal values. Extend the check to \NN and \N and fix up resulting failures.
author Jim Hague <jim.hague@acm.org>
date Wed, 08 Feb 2012 16:56:00 +0000
parents 2a1d97630f7f
children a6941d7033fa f64b25f147d7
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Feb 06 16:35:14 2012 -0600
+++ b/contrib/check-code.py	Wed Feb 08 16:56:00 2012 +0000
@@ -54,7 +54,7 @@
     (r'head -c', "don't use 'head -c', use 'dd'"),
     (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"),
     (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"),
-    (r'printf.*\\\d\d\d', "don't use 'printf \NNN', use Python"),
+    (r'printf.*\\\d{1,3}', "don't use 'printf \NNN', use Python"),
     (r'printf.*\\x', "don't use printf \\x, use Python"),
     (r'\$\(.*\)', "don't use $(expr), use `expr`"),
     (r'rm -rf \*', "don't use naked rm -rf, target a directory"),