# HG changeset patch # User FUJIWARA Katsunori # Date 1478000376 -32400 # Node ID 01703a8b8a4605b19f949bc31331d21aa17b12f8 # Parent 4e934804cafe6cccb1c3ac1f182eeab4b86e8013 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. diff -r 4e934804cafe -r 01703a8b8a46 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