Commits

Tarek Ziadé committed a5af8c9

make sure flake8 is clean

  • Participants
  • Parent commits e2c1e73

Comments (0)

Files changed (5)

-#!/home/tarek/dev/bitbucket.org/flake8-clean/bin/python
+#!/home/tarek/dev/bitbucket.org/flk8/bin/python
 from flake8.run import main
 
 if __name__ == '__main__':

File flake8/mccabe.py

     http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
     MIT License.
 """
-
-import compiler, optparse, sys
+import compiler
+import optparse
+import sys
 
 
 class PathNode:
         self.look = look
 
     def to_dot(self):
-        print 'node [shape=%s,label="%s"] %d;' % (self.look, self.name, self.dot_id())
+        print 'node [shape=%s,label="%s"] %d;' % \
+                (self.look, self.name, self.dot_id())
 
     def dot_id(self):
         return id(self)
 
 def main(argv):
     opar = optparse.OptionParser()
-    opar.add_option("-d", "--dot", dest="dot", help="output a graphviz dot file", action="store_true")
-    opar.add_option("-m", "--min", dest="min", help="minimum complexity for output", type="int", default=2)
+    opar.add_option("-d", "--dot", dest="dot",
+                    help="output a graphviz dot file", action="store_true")
+    opar.add_option("-m", "--min", dest="min",
+                    help="minimum complexity for output", type="int",
+                    default=2)
 
     options, args = opar.parse_args(argv)
 
-    text = open(args[0], "rU").read()+'\n\n'
+    text = open(args[0], "rU").read() + '\n\n'
     ast = compiler.parse(text)
     visitor = PathGraphingAstVisitor()
     visitor.preorder(ast, visitor)

File flake8/pep8.py

     # Python 3: decode to latin-1.
     # This function is lazy, it does not read the encoding declaration.
     # XXX: use tokenize.detect_encoding()
-    def readlines(filename):
+    def readlines(filename):        # NOQA
         return open(filename, encoding='latin-1').readlines()
 
 

File flake8/pyflakes.py

                 importation.used = (self.scope, node.lineno)
             self.addBinding(node.lineno, importation)
 
+
 def checkPath(filename):
     """
     Check the given path, printing out any warnings detected.
         print >> sys.stderr, "%s: %s" % (filename, msg.args[1])
         return 1
 
+
 def check(codeString, filename):
     """
     Check the Python source given by C{codeString} for flakes.
             valid_warnings += 1
 
         return valid_warnings
-

File flake8/util.py

 
 def skip_warning(warning):
     # XXX quick dirty hack, just need to keep the line in the warning
-    line = open(warning.filename).readlines()[warning.lineno-1]
+    line = open(warning.filename).readlines()[warning.lineno - 1]
     return skip_line(line)
 
+
 def skip_line(line):
     return line.strip().lower().endswith('# noqa')