1. Tarek Ziadé
  2. flake8


John Watson  committed 7158ae6

Clear os.walk's dirnames to properly exclude dirs

I have a project:

Running: `flake8 --exclude="foo" ./`


This patch prevents the continued walking of **foo**'s subdirectories and not
just files.

  • Participants
  • Parent commits a38b3ed
  • Branches refactor

Comments (0)

Files changed (1)

File flake8/main.py

View file
  • Ignore whitespace
         if os.path.isdir(path):
             for dirpath, dirnames, filenames in os.walk(path):
                 if pep8style.excluded(dirpath):
+                    dirnames[:] = []
                 for filename in filenames:
                     if not filename.endswith('.py'):