Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

per-file-ignores not respected when overlapping files via globs #1369

Closed
paw-lu opened this issue Aug 6, 2021 · 2 comments
Closed

per-file-ignores not respected when overlapping files via globs #1369

paw-lu opened this issue Aug 6, 2021 · 2 comments

Comments

@paw-lu
Copy link

paw-lu commented Aug 6, 2021

Please describe how you installed Flake8

Example:

$ python -m pip install flake8

Please provide the exact, unmodified output of flake8 --bug-report

% flake8 --bug-report
Usage: flake8 [OPTIONS] [PY_FILE]...
Try 'flake8 --help' for help.

Error: no such option: --bug-report

(what went wrong here?)

Please describe the problem or feature

If is specified twice in per-file-ignores—one explicitly one implicitly via globs (*), the ignored violation codes are not respected.

If this is a bug report, please explain with examples (and example code) what you expected to happen and what actually happened.

With a project of the format:

.
├── dir
│  ├── bar.py
│  └── foo.py
└── .flake8
"""foo.py"""
a = (1,2)
"""bar.py"""
import os

a = (1,2)
# .flake8
[flake8]
per-file-ignores = 
    dir/*:E231
    dir/bar.py:F401

What I expect

I expect E231 to be ignored in both files, and F401 to be ignored in bar.py.

What happens

% flake8 dir/*
dir/bar.py:3:7: E231 missing whitespace after ','

Only F401 is ignored in bar.py, but not not E231.

@asottile
Copy link
Member

asottile commented Aug 6, 2021

dupe #670

I'm also suspicious of your flake8 installation if --bug-report isn't working you've probably got a bigger problem with your installation

@asottile asottile closed this as completed Aug 6, 2021
@paw-lu
Copy link
Author

paw-lu commented Aug 6, 2021

dupe #670

Good catch. Sorry for missing that.

I'm also suspicious of your flake8 installation if --bug-report isn't working you've probably got a bigger problem with your installation

Yeah I had some path confusion there and wasn't calling the right flake8 for that command. Thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants