]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
practracker: make filename terminology uniform
authorNick Mathewson <nickm@torproject.org>
Thu, 29 Aug 2019 13:20:27 +0000 (09:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 29 Aug 2019 13:20:27 +0000 (09:20 -0400)
Previously we often referred to "C files" and "H files", which is
more ambiguous than ".c files" and ".h files".

scripts/maint/practracker/README
scripts/maint/practracker/includes.py
scripts/maint/practracker/practracker.py

index d2ad8220c9ec22133c2244b21f285c72ae234280..d978b398060f3671e805b3cb1b7043ca790641c0 100644 (file)
@@ -5,10 +5,10 @@ get worse.
 Right now, practracker looks for the following kinds of
 best-practices violations:
 
-  C files greater than 3000 lines long
-  H files greater than 500 lines long
-  C files with more than 50 includes
-  H files with more than 15 includes
+  .c files greater than 3000 lines long
+  .h files greater than 500 lines long
+  .c files with more than 50 includes
+  .h files with more than 15 includes
 
   All files that include a local header not listed in a .may_include
   file in the same directory, when that .may_include file has an
index fcc527c983f9d747bf4f4481a38a8fc5d47bd32a..397439b4efaee9c4af811c698af7d0b4ee8ccc4e 100755 (executable)
@@ -212,7 +212,7 @@ def consider_include_rules(fname, f):
     log_sorted_levels = False
 
 def walk_c_files(topdir="src"):
-    """Run through all c and h files under topdir, looking for
+    """Run through all .c and .h files under topdir, looking for
        include-rule violations. Yield those violations."""
 
     for dirpath, dirnames, fnames in os.walk(topdir):
index 73e4cb3e8b7c707642b69055d5808a6ea8c5db54..b477cd60c0bbe00ecc0ebb74e0b9ebdb432c0084 100755 (executable)
@@ -8,7 +8,7 @@ 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,
-for C files and headers.
+for C source files and headers.
 
 practracker.py should be run with its second argument pointing to the Tor
 top-level source directory like this:
@@ -144,10 +144,10 @@ 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 C file of more than {MAX_FILE_SIZE} lines, or an H
+#   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 an H file with more than {MAX_H_INCLUDE_COUNT} #includes.
+#   include-count -- a .c file with more than {MAX_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.
 #
@@ -189,13 +189,13 @@ def main(argv):
     parser.add_argument("--terse", action="store_true",
                         help="Do not emit helpful instructions.")
     parser.add_argument("--max-h-file-size", default=MAX_H_FILE_SIZE,
-                        help="Maximum lines per .H file")
+                        help="Maximum lines per .h file")
     parser.add_argument("--max-h-include-count", default=MAX_H_INCLUDE_COUNT,
-                        help="Maximum includes per .H file")
+                        help="Maximum includes per .h file")
     parser.add_argument("--max-file-size", default=MAX_FILE_SIZE,
-                        help="Maximum lines per C file")
+                        help="Maximum lines per .c file")
     parser.add_argument("--max-include-count", default=MAX_INCLUDE_COUNT,
-                        help="Maximum includes per C file")
+                        help="Maximum includes per .c file")
     parser.add_argument("--max-function-size", default=MAX_FUNCTION_SIZE,
                         help="Maximum lines per function")
     parser.add_argument("--max-dependency-violations", default=MAX_DEP_VIOLATIONS,