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

flake8 errors missing from *Flycheck errors* buffer #11

Closed
posita opened this issue Dec 12, 2017 · 4 comments
Closed

flake8 errors missing from *Flycheck errors* buffer #11

posita opened this issue Dec 12, 2017 · 4 comments

Comments

@posita
Copy link
Contributor

posita commented Dec 12, 2017

I have pycheckers set up with flake8, mypy, and pylint. I'm not sure when this started happening, but flake8 items no longer appear in the error list. They still show up in the minibuffer though when the cursor is on an offending line:

screen shot 2017-12-12 at 10 57 47

$ flake8 --version
3.5.0 (mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.6.0 on Darwin

I'm still investigating the underlying cause, but I suspect flake8 may have changed its output format?


Test file:

from typing import Type

class A(object): pass
class B(object): pass

a = None  # type: A
a = A()
a = B()

def foo(arg1, arg2):
    return arg1.member, arg2.member
@posita posita changed the title Errors missing from *Flycheck errors* buffer flake8 errors missing from *Flycheck errors* buffer Dec 12, 2017
@msherry
Copy link
Owner

msherry commented Dec 12, 2017

@posita Thanks for the report! I'm currently running a different version of flake8, so it's very possible that the format has changed.

msherry@msherry-mbp$ flake8 --version
3.3.0 (mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.5.0) CPython 2.7.13 on Darwin

That said, though, it seems weird that it would show up in one place but not another if there was a parse issue. I notice that you're running elpy, which has its own flake8 integration. Can you confirm the value of flycheck-pycheckers-checkers and ensure that flake8 is actually being run by flycheck-pycheckers, rather than elpy?

If so, I'll try to find some time to investigate this soon and release a fix!

@posita
Copy link
Contributor Author

posita commented Dec 12, 2017

smacks forehead

Weird. flake8 was unchecked. I have no idea how/when that happened. Apologies for the red herring! 😳

As an aside, if I remove all customizations for that variable, it defaults to pylint, mypy 2, and mypy 3.

UPDATE: The noted defaults are intended. I wonder when I screwed up my own config. 🤔 In any event, apologies again for the distraction! 😞

@posita posita closed this as completed Dec 12, 2017
@sfavazza
Copy link

Even if after some years...
I got exactly into the same issue recently.

Elpy runs the flake8 command only when a python file is visited for the first time (or reverted), then it passes the control to flymake.
To prevent any collision I disabled flymake and enabled flycheck with:

(add-hook 'elpy-mode-hook 'flymake-mode-off)
(add-hook 'elpy-mode-hook 'flycheck-mode)

Then to prevent elpy from running flake8 I set an invalid command string:

(setq elpy-syntax-check-command "none")

Moreover I changed the checkers for flycheck-pychechers to:

(setq flycheck-pycheckers-checkers (quote (flake8)))

With this setup the Flycheck errors buffer is empty, though if I run the flycheck-pycheckers python script from shell with --checker flake8 option I get all the flake8 messages.

image

image

Might it be a wrong parsing through Flyckech, i.e. an erroneous checker definition in the flycheck-pychecker.el file?

@msherry
Copy link
Owner

msherry commented Nov 12, 2019

@sfavazza Thanks for the report! It looks like the output of flake8 is different than the regex is expecting -- e.g. the first item in an output line is "WARNING/ERROR", while the checker is expecting a filename first.

I've opened a separate issue (#47) to track this -- let's continue the conversation there.

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

3 participants