2

I have a directory called "Old stuff" that I want flake8 to not lint code in this directory.

What is the correct syntax to exclude it?

I looked at the documentation for configuring flake8 but did not find what I wanted.

I tried in my .flake8 file:

[flake8]
max-line-length = 99
exclude =
    # Don't check the Old directories
    # Attempt 1
    Old\ stuff
    # Attempt 2
    "Old stuff"
    # Attempt 3
    /Old stuff/
    # Attempt 4
    ./Old stuff/
    # Attempt 5
    /Old\ stuff/

None of those syntax works.

Same problem when trying to exclude on the command line:

flake8 --exclude=Old\ stuff
apaderno
  • 28,547
  • 16
  • 75
  • 90
Julien Rousé
  • 1,115
  • 1
  • 15
  • 30

1 Answers1

2

To get flake8 to ignore the directory with the whitespace, this syntax works:

[flake8]
max-line-length = 99
exclude =
    # Don't check the Old directories
    Old*stuff

For the command line:

flake8 --exclude=Old*stuff
Julien Rousé
  • 1,115
  • 1
  • 15
  • 30