Просмотр исходного кода

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>
Arnout Vandecappelle 2 лет назад
Родитель
Сommit
90533b6899
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      utils/check-package

+ 2 - 0
utils/check-package

@@ -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)