# HG changeset patch # User Simon Heimberg # Date 2013-07-01 04:50:58 # Node ID 5aeb03b48ab4b65f797bf8a4a2be5007da4faac1 # Parent e033a7d444ac2856948f245f463cfef39e5a48f0 check-code: concatenate "check-code" on compile time The python compiler concatenates two string constants. Use this instead of doing it on run time or instruct the user how to do it. The strings "no-check-code" and "check-code-ignore" has to be specially written for not skipping some checking of the code of this file. diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -410,9 +410,9 @@ def checkfile(f, logfunc=_defaultlogger. fp = open(f) pre = post = fp.read() fp.close() - if "no-" + "check-code" in pre: + if "no-" "check-code" in pre: if debug: - print "Skipping %s for %s it has no- and check-code" % ( + print "Skipping %s for %s it has no-" " check-code" % ( name, f) break for p, r in filters: @@ -451,9 +451,9 @@ def checkfile(f, logfunc=_defaultlogger. n += 1 l = prelines[n] - if "check-code" + "-ignore" in l: + if "check-code" "-ignore" in l: if debug: - print "Skipping %s for %s:%s (check-code -ignore)" % ( + print "Skipping %s for %s:%s (check-code" "-ignore)" % ( name, f, n) continue elif ignore and re.search(ignore, l, re.MULTILINE):