[PATCH 3 of 9 hglib] checkcode: remove a few checks that aren't relevant for us

Idan Kamara idankk86 at gmail.com
Tue Aug 23 14:04:31 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1314124893 -10800
# Node ID d73a516dfb6a9216ee3770e06a421da54516c397
# Parent  afd213f7cb421e41f6ed6cea0408e57fada444e3
checkcode: remove a few checks that aren't relevant for us

diff -r afd213f7cb42 -r d73a516dfb6a tests/check-code.py
--- a/tests/check-code.py	Tue Aug 23 21:41:33 2011 +0300
+++ b/tests/check-code.py	Tue Aug 23 21:41:33 2011 +0300
@@ -168,22 +168,6 @@
      "comparison with singleton, use 'is' or 'is not' instead"),
     (r'^\s*(while|if) [01]:',
      "use True/False for constant Boolean expression"),
-    (r'(?<!def)\s+hasattr',
-     'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
-    (r'opener\([^)]*\).read\(',
-     "use opener.read() instead"),
-    (r'opener\([^)]*\).write\(',
-     "use opener.write() instead"),
-    (r'[\s\(](open|file)\([^)]*\)\.read\(',
-     "use util.readfile() instead"),
-    (r'[\s\(](open|file)\([^)]*\)\.write\(',
-     "use util.readfile() instead"),
-    (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
-     "always assign an opened file to a variable, and close it afterwards"),
-    (r'[\s\(](open|file)\([^)]*\)\.',
-     "always assign an opened file to a variable, and close it afterwards"),
-    (r'(?i)descendent', "the proper spelling is descendAnt"),
-    (r'\.debug\(\_', "don't mark debug messages for translation"),
   ],
   # warnings
   [


More information about the Mercurial-devel mailing list