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

Simon Heimberg simohe at besonet.ch
Thu Jan 9 08:52:33 CST 2014


# HG changeset patch
# User Simon Heimberg <simohe at 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.

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


More information about the Mercurial-devel mailing list