I have my flake8
config file in ~/.config/flake8
[flake8]
max-line-length = 100
However when I run flake8
the config file is not picked up. I know that because i still get warnings over lines longer than 79 char.
I'm on redhat, but the same happens on mac.
I use pyenv. Global is 2.7.6 (not even sure this is relevant)
Flake8 allows a user to use “global” configuration file to store preferences. The user configuration file is expected to be stored somewhere in the user's “home” directory. On Windows the “home” directory will be something like C:\\Users\sigmavirus24 , a.k.a, ~\ .
Flake8 is a Python library that wraps PyFlakes, pycodestyle and Ned Batchelder's McCabe script. It is a great toolkit for checking your code base against coding style (PEP8), programming errors (like “library imported but unused” and “Undefined name”) and to check cyclomatic complexity.
I had a silly mistake, leaving out the [flake8]
tag at the beginning of my configuration file I just spent 2 hours debugging this problem.
Here was my original .flake8
file:
ignore=
# line too long
E501,
#line break after binary operator
W504
This was the fix:
[flake8]
ignore=
# line too long
E501,
#line break after binary operator
W504
Obviously this wasn't OP's problem: they have the tag in there. But if I can save one person from my stupidity, I will be happy. Frankly I was almost too embarrassed to post this because it is an "Is your computer plugged in?" level error, but oh well.
Sharing my mistake in case this can help someone:
I had a similar issue which was simply due to a bad file name: .flake8.txt
instead of .flake8
.
Correcting resolves the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With