check-code: discard filtering result of previous check for independence stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 01 Nov 2016 20:39:36 +0900
branchstable
changeset 30245 01703a8b8a46
parent 30244 4e934804cafe
child 30246 b4c0f8d5edd2
check-code: discard filtering result of previous check for independence Before this patch, check-code.py applies filtering on the file content, to which filtering of previous check is already applied. This might hide issues, which should be detected by a subsequent check in "checks" list. Fortunately, this problem hasn't appeared, because there is no overlapping of filename matching (examined in the order below). 1. *.py or *.cgi 2. test-* (not *.t suffix) 3. *.c or *.h 4. *.t 5. *.txt 6. *.tmpl For example, adding a test, which wants to examine raw comment text in *.py files, at the end of current "checks" list doesn't work as expected, because a filter for *.py files normalizes comment text in them. Putting such test at the beginning of "checks" list also resolves this problem, but such dependence on the order decreases maintainability of check-code.py itself. This patch discards filtering result of previous check at the beginning of each checks, for independence of each checks.
contrib/check-code.py
--- a/contrib/check-code.py	Tue Nov 01 20:39:36 2016 +0900
+++ b/contrib/check-code.py	Tue Nov 01 20:39:36 2016 +0900
@@ -537,6 +537,7 @@
         return result
 
     for name, match, magic, filters, pats in checks:
+        post = pre # discard filtering result of previous check
         if debug:
             print(name, f)
         fc = 0