Patchwork [4,of,4] check-code: tighten the check for `ls -R`

login
register
mail settings
Submitter Matt Harbison
Date March 31, 2018, 10:28 p.m.
Message ID <0d8b5aa297053419ed4a.1522535307@Envy>
Download mbox | patch
Permalink /patch/30082/
State Accepted
Headers show

Comments

Matt Harbison - March 31, 2018, 10:28 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1522526066 14400
#      Sat Mar 31 15:54:26 2018 -0400
# Node ID 0d8b5aa297053419ed4a46678462aa295803cbeb
# Parent  f3e750cdf0b3fb1977b7ea0f7685d2a86d3c199c
check-code: tighten the check for `ls -R`

Otherwise, this was flagging `... lfs.serve=False -R server ...` in the tests.

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -111,7 +111,7 @@  testpats = [
     (r'head -c', "don't use 'head -c', use 'dd'"),
     (r'tail -n', "don't use the '-n' option to tail, just use '-<num>'"),
     (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"),
-    (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"),
+    (r'\bls\b.*-\w*R', "don't use 'ls -R', use 'find'"),
     (r'printf.*[^\\]\\([1-9]|0\d)', r"don't use 'printf \NNN', use Python"),
     (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
     (r'\$\(.*\)', "don't use $(expr), use `expr`"),