Commits

kilian committed edc6d5b

Respect exclude option from pep8 - fixes #23

Modify the util.skip_file() method to honor the pep8 exclude
option from .pep8 config file or from the command line.

Comments (0)

Files changed (2)

                     if not filename.endswith('.py'):
                         continue
                     fullpath = os.path.join(dirpath, filename)
-                    if not skip_file(fullpath):
+                    if not skip_file(fullpath, pep8style):
                         yield fullpath
 
         else:
-            if not skip_file(path):
+            if not skip_file(path, pep8style):
                 yield path
 
 
             seen.add(file_)
             if not file_.endswith('.py'):
                 continue
-            if skip_file(file_):
+            if skip_file(file_, pep8style):
                 continue
             yield file_
 
 _NOQA = re.compile(r'flake8[:=]\s*noqa', re.I | re.M)
 
 
-def skip_file(path):
+def skip_file(path, pep8style):
     """Returns True if this header is found in path
 
     # flake8: noqa
         content = f.read()
     finally:
         f.close()
-    return _NOQA.search(content) is not None
+    return _NOQA.search(content) is not None or pep8style.excluded(path)