summaryrefslogtreecommitdiff
path: root/scripts/maint/practracker/practracker.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-08-21 10:00:05 -0400
committerNick Mathewson <nickm@torproject.org>2019-08-21 10:17:26 -0400
commit5b3741e05ac82cbe99942cffdc5662bd53c783dc (patch)
tree079547e6d89576ed9c838d3f5afcf659a3af88db /scripts/maint/practracker/practracker.py
parentcc48eff2d3b07a8dd2f621f09217ba29b4e6771c (diff)
downloadtor-5b3741e05ac82cbe99942cffdc5662bd53c783dc.tar.gz
tor-5b3741e05ac82cbe99942cffdc5662bd53c783dc.zip
Document new practracker violation types, and add a practracker readme
Closes ticket 31476.
Diffstat (limited to 'scripts/maint/practracker/practracker.py')
-rwxr-xr-xscripts/maint/practracker/practracker.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index 6483b88da1..73e4cb3e8b 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -7,7 +7,8 @@ Go through the various .c files and collect metrics about them. If the metrics
violate some of our best practices and they are not found in the optional
exceptions file, then log a problem about them.
-We currently do metrics about file size, function size and number of includes.
+We currently do metrics about file size, function size and number of includes,
+for C files and headers.
practracker.py should be run with its second argument pointing to the Tor
top-level source directory like this:
@@ -143,8 +144,12 @@ HEADER="""\
#
# 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.
+# file-size -- a C file of more than {MAX_FILE_SIZE} lines, or an H
+# file with more than {MAX_H_FILE_SIZE} lines.
+# include-count -- a C file with more than {MAX_INCLUDE_COUNT} #includes,
+ or an 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.
#
# Each line below represents a single exception that practracker should
# _ignore_. Each line has four parts: