|
15 | 15 |
|
16 | 16 | os.environ['LC_ALL'] = 'C' |
17 | 17 |
|
18 | | -ENABLED_CHECKS = ( |
| 18 | +ALWAYS_ENABLED_WARNINGS = ( |
19 | 19 | "Class '.*' has a constructor with 1 argument that is not explicit.", |
20 | 20 | "Struct '.*' has a constructor with 1 argument that is not explicit.", |
21 | 21 | "Function parameter '.*' should be passed by const reference.", |
|
33 | 33 | # ".*", |
34 | 34 | ) |
35 | 35 |
|
36 | | -IGNORED_WARNINGS = ( |
| 36 | +SUPPRESSED_WARNINGS = ( |
37 | 37 | "src/stacktraces.cpp:.*: .*: Parameter 'info' can be declared as pointer to const", |
38 | 38 | "src/stacktraces.cpp:.*: note: You might need to cast the function pointer here", |
39 | 39 |
|
@@ -72,8 +72,8 @@ def main(): |
72 | 72 | files_output = subprocess.check_output(['git', 'ls-files', '--'] + patterns, universal_newlines=True, encoding="utf8") |
73 | 73 | files = [f.strip() for f in files_output.splitlines() if f.strip()] |
74 | 74 |
|
75 | | - enabled_regexp = '|'.join(ENABLED_CHECKS) |
76 | | - ignored_regexp = '|'.join(IGNORED_WARNINGS) |
| 75 | + always_enabled_regexp = '|'.join(ALWAYS_ENABLED_WARNINGS) |
| 76 | + suppressed_regexp = '|'.join(SUPPRESSED_WARNINGS) |
77 | 77 | files_regexp = '|'.join(re.escape(f) for f in files) |
78 | 78 |
|
79 | 79 | script_dir = os.path.dirname(os.path.abspath(__file__)) |
@@ -120,14 +120,14 @@ def main(): |
120 | 120 | for line in unique_sorted_lines: |
121 | 121 | if not re.search(files_regexp, line): |
122 | 122 | continue |
123 | | - if re.search(enabled_regexp, line) or not re.search(ignored_regexp, line): |
| 123 | + if re.search(always_enabled_regexp, line) or not re.search(suppressed_regexp, line): |
124 | 124 | warnings.append(line) |
125 | 125 |
|
126 | 126 | if warnings: |
127 | 127 | print('\n'.join(warnings)) |
128 | 128 | print() |
129 | 129 | print("Advice not applicable in this specific case? Add an exception by updating") |
130 | | - print(f"IGNORED_WARNINGS in {__file__}") |
| 130 | + print(f"SUPPRESSED_WARNINGS in {__file__}") |
131 | 131 | # Uncomment to enforce the linter / comment to run locally |
132 | 132 | exit_code = 1 |
133 | 133 |
|
|
0 commit comments