Patchwork [1,of,4] check-code: make 'ls' pattern less invasive

login
register
mail settings
Submitter Yuya Nishihara
Date June 8, 2016, 2:22 p.m.
Message ID <0e1ab95eb44498ab07cb.1465395779@mimosa>
Download mbox | patch
Permalink /patch/15435/
State Accepted
Headers show

Comments

Yuya Nishihara - June 8, 2016, 2:22 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1464698989 -32400
#      Tue May 31 21:49:49 2016 +0900
# Node ID 0e1ab95eb44498ab07cbaeef0ed44e0c6e35ba95
# Parent  de4a80a2b45c6fcae0948ac12872dd8a61ced26a
check-code: make 'ls' pattern less invasive

I got false positive at "--tls smtps --certificate ...".

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -122,7 +122,7 @@  testpats = [
     (r'export .*=', "don't export and assign at once"),
     (r'^source\b', "don't use 'source', use '.'"),
     (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"),
-    (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"),
+    (r'\bls +[^|\n-]+ +-', "options to 'ls' must come before filenames"),
     (r'[^>\n]>\s*\$HGRCPATH', "don't overwrite $HGRCPATH, append to it"),
     (r'^stop\(\)', "don't use 'stop' as a shell function name"),
     (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),