Skip to content

Commit b16de35

Browse files
committed
test: more clear names of white & black list for cpp check: ALWAYS_ENABLED_WARNINGS / SUPPRESSED_WARNINGS
1 parent 12cb797 commit b16de35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/lint/lint-cppcheck-dash.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
os.environ['LC_ALL'] = 'C'
1717

18-
ENABLED_CHECKS = (
18+
ALWAYS_ENABLED_WARNINGS = (
1919
"Class '.*' has a constructor with 1 argument that is not explicit.",
2020
"Struct '.*' has a constructor with 1 argument that is not explicit.",
2121
"Function parameter '.*' should be passed by const reference.",
@@ -33,7 +33,7 @@
3333
# ".*",
3434
)
3535

36-
IGNORED_WARNINGS = (
36+
SUPPRESSED_WARNINGS = (
3737
"src/stacktraces.cpp:.*: .*: Parameter 'info' can be declared as pointer to const",
3838
"src/stacktraces.cpp:.*: note: You might need to cast the function pointer here",
3939

@@ -72,8 +72,8 @@ def main():
7272
files_output = subprocess.check_output(['git', 'ls-files', '--'] + patterns, universal_newlines=True, encoding="utf8")
7373
files = [f.strip() for f in files_output.splitlines() if f.strip()]
7474

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)
7777
files_regexp = '|'.join(re.escape(f) for f in files)
7878

7979
script_dir = os.path.dirname(os.path.abspath(__file__))
@@ -120,14 +120,14 @@ def main():
120120
for line in unique_sorted_lines:
121121
if not re.search(files_regexp, line):
122122
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):
124124
warnings.append(line)
125125

126126
if warnings:
127127
print('\n'.join(warnings))
128128
print()
129129
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__}")
131131
# Uncomment to enforce the linter / comment to run locally
132132
exit_code = 1
133133

0 commit comments

Comments
 (0)