diff options
author | Ricardo Martincoski <ricardo.martincoski@gmail.com> | 2019-01-27 16:59:41 -0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2019-01-29 16:37:47 +0100 |
commit | 4a6c5ab2c31f732802a7ac643ca6335821d6d38f (patch) | |
tree | 79838f2381ab34be2904fb71b0668183a9487715 /utils/check-package | |
parent | 908a8b5a7fb5744c55adbe609dca991709b2181a (diff) | |
download | buildroot-4a6c5ab2c31f732802a7ac643ca6335821d6d38f.tar.gz buildroot-4a6c5ab2c31f732802a7ac643ca6335821d6d38f.zip |
utils/check-package: allow to disable warning for a line
Currently any exceptions for a check function need to be coded into the
check-package script itself.
Create a pattern that can be used in a comment to make check-package
ignore one or more warning types in the line immediately below:
# check-package Indent, VariableWithBraces
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'utils/check-package')
-rwxr-xr-x | utils/check-package | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/check-package b/utils/check-package index 26439f08eb..ce1fe98d67 100755 --- a/utils/check-package +++ b/utils/check-package @@ -132,10 +132,14 @@ def check_file_using_lib(fname): f = open(fname, "r", errors="surrogateescape") else: f = open(fname, "r") + lastline = "" for lineno, text in enumerate(f.readlines()): nlines += 1 for cf in objects: + if cf.disable.search(lastline): + continue nwarnings += print_warnings(cf.check_line(lineno + 1, text)) + lastline = text f.close() for cf in objects: nwarnings += print_warnings(cf.after()) |