[PATCH 1 of 4 RFC] pyflakes: ignore files marked no-check-code

Augie Fackler durin42 at gmail.com
Fri May 6 10:41:01 CDT 2011


# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# Date 1304695027 18000
# Node ID d84daa1d596d3cbacb594eb28638b68148fce346
# Parent  680c3c6fcb48652ac982b568430ab8a9f03e857f
pyflakes: ignore files marked no-check-code

diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py
--- a/tests/filterpyflakes.py
+++ b/tests/filterpyflakes.py
@@ -2,7 +2,7 @@
 
 # Filter output by pyflakes to control which warnings we check
 
-import sys, re
+import sys, re, os
 
 def makekey(message):
     # "path/file:line: message"
@@ -25,6 +25,12 @@
            ]
     if not re.search('|'.join(pats), line):
         continue
+    fn = line.split(':', 1)[0]
+    f = open(os.path.join(os.path.dirname(os.path.dirname(__file__)), fn))
+    data = f.read()
+    f.close()
+    if 'no-check-code' in data:
+        continue
     lines.append(line)
 
 for line in sorted(lines, key = makekey):


More information about the Mercurial-devel mailing list