-
Notifications
You must be signed in to change notification settings - Fork 23
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
pycheckers.py overrides values from flake8 config by passing explicit --ignore= #12
Comments
Thanks for filing the issue! I don't use flake8 much myself anymore, so I'm not sure that I've observed this specific bug, but it definitely sounds like it could apply to other checkers, as well. I'll definitely take a look at this as soon as I can. Can you confirm that, if you just comment out the
line in pycheckers.py, that the checker works as expected? That will give me a good starting point towards tracking down a workable fix. |
Yup! When that line is commented out in
Just curious (not related to this issue), but was that because you found something better, that |
Sorry for the delay in getting to this -- work (in languages other than Python) has been getting in the way. I took a quick look at this last night, and I think we can solve this as you suggest, by giving different options to
Does this match your understanding? If so, I think I can have a fix out pretty quickly. |
You're not going to get any judgment from me. I could've gotten off my duff and submitted a PR.
😏
I'm not sure this is responsive, but your description mirrors how I observe $ flake8 foo.py # defers to `ignore` in config
$ flake8 --ignore= foo.py # includes all errors (i.e., ignores no errors; overrides `ignore` in config)
foo.py:1:80: E501 line too long (81 > 79 characters)
foo.py:3:1: E302 expected 2 blank lines, found 0
foo.py:3:30: E701 multiple statements on one line (colon)
foo.py:4:1: E305 expected 2 blank lines after class or function definition, found 0
foo.py:4:1: E402 module level import not at top of file
$ flake8 --ignore=E302,E501 foo.py # includes all errors *except* those listed (i.e., ignores only provided errors; overrides `ignore` in config)
foo.py:3:30: E701 multiple statements on one line (colon)
foo.py:4:1: E305 expected 2 blank lines after class or function definition, found 0
foo.py:4:1: E402 module level import not at top of file Am I answering your question? |
Yup, just want to make sure of what the intended behavior should be. Mirroring what existing tools do is a good start. I'll write a fix for this soon-ish. |
This allows us to differentiate between "ignore no codes (enable all warnings/errors)" vs. "don't specify anything for the `ignore` option, use config files instead." Fixes #12
This allows us to differentiate between "ignore no codes (enable all warnings/errors)" vs. "don't specify anything for the `ignore` option, use config files instead." Fixes #12
@posita Want to take a look at this diff and see if it fixes this issue in a way that seems intuitive for you? You'll need to |
Sorry for the delay in my response. This looks like it should do the trick. 👍 (I'm pretty sure I already have |
This looks like it's happening because
flake8
is given an explicit--ignore=
parameter, which overrides config file values:If one wants to be able customize ignored errors from Emacs, one likely needs a way to differentiate between "don't pass any
--ignore
argument to the underlying linter" and "pass--ignore=
to the underlying linter, because I don't want to ignore anything". I toyed around with the idea of trying to omit the--ignore
parameter topycheckers.py
whereflycheck-pycheckers-ignore-codes
wasnil
(and optionally setting its default tonil
), but I'm not sure if this is the right approach. That would likely require changes to bothflycheck-pycheckers.el
andpycheckers.py
.The text was updated successfully, but these errors were encountered: