summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xutils/check-package4
-rw-r--r--utils/checkpackagelib/base.py2
2 files changed, 6 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())
diff --git a/utils/checkpackagelib/base.py b/utils/checkpackagelib/base.py
index fc09bec9a2..9544a64e5a 100644
--- a/utils/checkpackagelib/base.py
+++ b/utils/checkpackagelib/base.py
@@ -1,10 +1,12 @@
# See utils/checkpackagelib/readme.txt before editing this file.
+import re
class _CheckFunction(object):
def __init__(self, filename, url_to_manual):
self.filename = filename
self.url_to_manual = url_to_manual
+ self.disable = re.compile(r"^\s*# check-package .*\b{}\b".format(self.__class__.__name__))
def before(self):
pass
OpenPOWER on IntegriCloud