Mercurial > hg
comparison contrib/check-code.py @ 16965:91284af53508
test-alias: adapt for Windows
The test used 'echo' to test '!' style aliases. On Windows 'echo' is handled
by cmd and thus behaves very differently from the 'normal' echo command.
The simple workaround used here for using the same alias on all platforms
is to use 'printf' instead. Msys 'printf' will also handle sh quoting and
escaping in cmd.
Environment variable expansion with sh syntax is handled by launching sh.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sat, 16 Jun 2012 21:57:42 +0200 |
parents | c2d9ef43ff6c |
children | bddf1220d7a2 |
comparison
equal
deleted
inserted
replaced
16964:eecaeeca2106 | 16965:91284af53508 |
---|---|
45 [ | 45 [ |
46 (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), | 46 (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), |
47 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), | 47 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), |
48 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), | 48 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), |
49 (r'sed.*-i', "don't use 'sed -i', use a temporary file"), | 49 (r'sed.*-i', "don't use 'sed -i', use a temporary file"), |
50 (r'echo.*\\n', "don't use 'echo \\n', use printf"), | 50 (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"), |
51 (r'echo -n', "don't use 'echo -n', use printf"), | 51 (r'echo -n', "don't use 'echo -n', use printf"), |
52 (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), | 52 (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"), |
53 (r'head -c', "don't use 'head -c', use 'dd'"), | 53 (r'head -c', "don't use 'head -c', use 'dd'"), |
54 (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), | 54 (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"), |
55 (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"), | 55 (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"), |