summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-25 15:51:48 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-25 16:09:11 -0400
commit301e3f22eff5021b0855a70cf98a1ccee69a19a8 (patch)
tree08a11a24d164138ed98deedf0d43d3e674f42645
parentc81b2b09eadf8ee8775f61831db055425bcf7d27 (diff)
downloadtor-301e3f22eff5021b0855a70cf98a1ccee69a19a8.tar.gz
tor-301e3f22eff5021b0855a70cf98a1ccee69a19a8.zip
Practracker: add a string explaining the excptions file.
-rwxr-xr-xscripts/maint/practracker/practracker.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index a6e6d0b607..aec7c8b295 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -113,6 +113,38 @@ def consider_metrics_for_file(fname, f):
return found_new_issues
+HEADER="""\
+# Welcome to the exceptions file for Tor's best-practices tracker!
+#
+# Each line of this file represents a single violation of Tor's best
+# practices -- ideally one that was grandfathered in from before practracker.py
+# existed.
+#
+# There are three kinds of problems that we recognize right now:
+# function-size -- a function of more than {MAX_FUNCTION_SIZE} lines.
+# file-size -- a file of more than {MAX_FILE_SIZE} lines.
+# include-count -- a file with more than {MAX_INCLUDE_COUNT} #includes.
+#
+# Each line below represents a single exception that practracker should
+# _ignore_. Each line has four parts:
+# 1. The word "problem".
+# 2. The kind of problem.
+# 3. The location of the problem: either a filename, or a
+# filename:functionname pair.
+# 4. The magnitude of the problem to ignore.
+#
+# So for example, consider this line:
+# problem file-size /src/core/or/connection_or.c 3200
+#
+# It tells practracker to allow the mentioned file to be up to 3200 lines
+# long, even though ordinarily it would warn about any file with more than
+# {MAX_FILE_SIZE} lines.
+#
+# You can either edit this file by hand, or regenerate it completely by
+# running `make practracker-regen`.
+
+""".format(**globals())
+
def main():
if (len(sys.argv) != 2):
print("Usage:\n\t$ practracker.py <tor topdir>\n\t(e.g. $ practracker.py ~/tor/)")