Show More
@@ -70,6 +70,26 b' testfilters = [' | |||
|
70 | 70 | (r"<<(\S+)((.|\n)*?\n\1)", rephere), |
|
71 | 71 | ] |
|
72 | 72 | |
|
73 | uprefix = r"^ \$ " | |
|
74 | utestpats = [ | |
|
75 | (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), | |
|
76 | (uprefix + r'.*\$\?', "explicit exit code checks unnecessary"), | |
|
77 | (uprefix + r'.*\|\| echo.*(fail|error)', | |
|
78 | "explicit exit code checks unnecessary"), | |
|
79 | (uprefix + r'set -e', "don't use set -e"), | |
|
80 | ] | |
|
81 | ||
|
82 | for p, m in testpats: | |
|
83 | if p.startswith('^'): | |
|
84 | p = uprefix + p[1:] | |
|
85 | else: | |
|
86 | p = uprefix + p | |
|
87 | utestpats.append((p, m)) | |
|
88 | ||
|
89 | utestfilters = [ | |
|
90 | (r"( *)(#([^\n]*\S)?)", repcomment), | |
|
91 | ] | |
|
92 | ||
|
73 | 93 | pypats = [ |
|
74 | 94 | (r'^\s*def\s*\w+\s*\(.*,\s*\(', |
|
75 | 95 | "tuple parameter unpacking not available in Python 3+"), |
@@ -157,6 +177,7 b' checks = [' | |||
|
157 | 177 | ('python', r'.*\.(py|cgi)$', pyfilters, pypats), |
|
158 | 178 | ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats), |
|
159 | 179 | ('c', r'.*\.c$', cfilters, cpats), |
|
180 | ('unified test', r'.*\.t$', utestfilters, utestpats), | |
|
160 | 181 | ] |
|
161 | 182 | |
|
162 | 183 | class norepeatlogger(object): |
General Comments 0
You need to be logged in to leave comments.
Login now