diff mbox series

[1/2] utils/check-package: allow exception for global checks

Message ID 20231007203633.2415431-1-arnout@mind.be
State New
Headers show
Series [1/2] utils/check-package: allow exception for global checks | expand

Commit Message

Arnout Vandecappelle Oct. 7, 2023, 8:36 p.m. UTC
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>
---
 utils/check-package | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/utils/check-package b/utils/check-package
index 105902303e..38119f7136 100755
--- a/utils/check-package
+++ b/utils/check-package
@@ -247,6 +247,8 @@  def check_file_using_lib(fname):
             lastline = text
 
     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)