utils/check-package: allow exception for global checks

check-package has a mechanism for a specific file to make an exception
to a specific checker, by preceding the offending line with
"check-package ... <checker class>". However, this is not possible for
the global checks that are done in the checker's after() function.

Allow exceptions for the global checks by writing the same
"check-package ... <checker class>" comment on the last line of the
file.

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Arnout Vandecappelle
2025-08-29 12:49:30 +02:00
committed by Arnout Vandecappelle
parent 4dc6865568
commit 90533b6899
+2
View File
@@ -276,6 +276,8 @@ def check_file_using_lib(fname):
return nwarnings, nlines
for name, cf in objects:
if cf.disable.search(lastline):
continue
warn, fail = print_warnings(cf.after(), name in xfail)
if fail > 0:
failed.add(name)