[tor-commits] [stem/master] Dropping runability of static_checks.py

atagar at torproject.org atagar at torproject.org
Sun Apr 14 04:33:47 UTC 2013


commit 02fb92e92892f58c18c4f2de1bcf831ee43f4ff6
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Apr 12 08:33:34 2013 -0700

    Dropping runability of static_checks.py
    
    Once upon a time static_checks.py had a single function that did a fair bit
    more validation. At that time it made sense for this to be runable as a
    standalone script. However, nowadays it's mostly just helpers for pyflakes and
    pep8.
---
 test/static_checks.py |   21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/test/static_checks.py b/test/static_checks.py
index 6d0a508..307a858 100644
--- a/test/static_checks.py
+++ b/test/static_checks.py
@@ -15,9 +15,6 @@ import os
 
 from stem.util import conf, system
 
-# if ran directly then run over everything one level up
-DEFAULT_TARGET = os.path.sep.join(__file__.split(os.path.sep)[:-1])
-
 # mapping of files to the issues that should be ignored
 PYFLAKES_IGNORE = None
 
@@ -27,7 +24,7 @@ CONFIG = conf.config_dict("test", {
 })
 
 
-def pep8_issues(base_paths = DEFAULT_TARGET):
+def pep8_issues(base_paths):
   """
   Checks for stylistic issues that are an issue according to the parts of PEP8
   we conform to.
@@ -98,7 +95,7 @@ def pep8_issues(base_paths = DEFAULT_TARGET):
   return issues
 
 
-def pyflakes_issues(base_paths = DEFAULT_TARGET):
+def pyflakes_issues(base_paths):
   """
   Checks for issues via pyflakes. False positives can be whitelisted via our
   test configuration.
@@ -151,7 +148,7 @@ def pyflakes_issues(base_paths = DEFAULT_TARGET):
   return issues
 
 
-def get_issues(base_paths = DEFAULT_TARGET):
+def get_issues(base_paths):
   """
   Checks python source code in the given directory for whitespace issues.
 
@@ -226,15 +223,3 @@ def _get_files_with_suffix(base_path, suffix = ".py"):
       for filename in files:
         if filename.endswith(suffix):
           yield os.path.join(root, filename)
-
-if __name__ == '__main__':
-  issues = get_issues()
-
-  for file_path in issues:
-    print file_path
-
-    for line_number, msg in issues[file_path]:
-      line_count = "%-4s" % line_number
-      print "  line %s %s" % (line_count, msg)
-
-    print





More information about the tor-commits mailing list