Patchwork [1,of,6,V2] check-code: do not skip entire file, skip only one match instead

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 9, 2014, 2:52 p.m.
Message ID <0db2ed7afb31e2c6e2ca.1389279153@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3283/
State Accepted
Commit 81e905790b306d346672495f5ec923848c4280ec
Headers show

Comments

Simon Heimberg - Jan. 9, 2014, 2:52 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1389130125 -3600
#      Tue Jan 07 22:28:45 2014 +0100
# Node ID 0db2ed7afb31e2c6e2ca26c4f7ffbdf556759a15
# Parent  6ef47fcd7c28ebbf13a6a58056b4695a813f78cc
check-code: do not skip entire file, skip only one match instead

Skipping of the entire file has been introduced in bc3b48b0f5c8.

Patch

diff -r 6ef47fcd7c28 -r 0db2ed7afb31 contrib/check-code.py
--- a/contrib/check-code.py	Sun Nov 17 15:43:46 2013 +0100
+++ b/contrib/check-code.py	Tue Jan 07 22:28:45 2014 +0100
@@ -226,7 +226,7 @@ 
     (r'^\s*except.* as .*:', "except as not available in Python 2.4"),
     (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
-     "any/all/format not available in Python 2.4"),
+     "any/all/format not available in Python 2.4", 'no-py24'),
     (r'(?<!def)\s+(callable)\(',
      "callable not available in Python 3, use getattr(f, '__call__', None)"),
     (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
diff -r 6ef47fcd7c28 -r 0db2ed7afb31 contrib/import-checker.py
--- a/contrib/import-checker.py	Sun Nov 17 15:43:46 2013 +0100
+++ b/contrib/import-checker.py	Tue Jan 07 22:28:45 2014 +0100
@@ -75,7 +75,7 @@ 
         # something in stdlib_prefixes. check-code suppressed because
         # the ast module used by this script implies the availability
         # of any().
-        if not any(libpath.startswith(p) for p in stdlib_prefixes): # no-check-code
+        if not any(libpath.startswith(p) for p in stdlib_prefixes): # no-py24
             continue
         if 'site-packages' in libpath:
             continue