aboutsummaryrefslogtreecommitdiff
path: root/scripts/maint/practracker/practracker.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/maint/practracker/practracker.py')
-rwxr-xr-xscripts/maint/practracker/practracker.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index ce9c5f5d82..5f26d28cea 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -147,7 +147,7 @@ HEADER="""\
# file-size -- a .c file of more than {MAX_FILE_SIZE} lines, or a .h
# file with more than {MAX_H_FILE_SIZE} lines.
# include-count -- a .c file with more than {MAX_INCLUDE_COUNT} #includes,
- or a .h file with more than {MAX_H_INCLUDE_COUNT} #includes.
+# or a .h file with more than {MAX_H_INCLUDE_COUNT} #includes.
# dependency-violation -- a file includes a header that it should
# not, according to an advisory .may_include file.
#
@@ -181,7 +181,7 @@ def main(argv):
parser.add_argument("--regen", action="store_true",
help="Regenerate the exceptions file")
parser.add_argument("--list-overbroad", action="store_true",
- help="List over-strict exceptions")
+ help="List over-broad exceptions")
parser.add_argument("--exceptions",
help="Override the location for the exceptions file")
parser.add_argument("--strict", action="store_true",
@@ -224,6 +224,11 @@ def main(argv):
filt.addThreshold(problem.DependencyViolationItem("*.c", int(args.max_dependency_violations)))
filt.addThreshold(problem.DependencyViolationItem("*.h", int(args.max_dependency_violations)))
+ if args.list_overbroad and args.regen:
+ print("Cannot use --regen with --list-overbroad",
+ file=sys.stderr)
+ sys.exit(1)
+
# 1) Get all the .c files we care about
files_list = util.get_tor_c_files(TOR_TOPDIR, args.include_dir)
@@ -239,6 +244,10 @@ def main(argv):
ProblemVault = problem.ProblemVault(exceptions_file)
problem_file = sys.stdout
+ if args.list_overbroad:
+ # If we're listing overbroad exceptions, don't list problems.
+ problem_file = util.NullFile()
+
# 2.1) Adjust the exceptions so that we warn only about small problems,
# and produce errors on big ones.
if not (args.regen or args.list_overbroad or args.strict):