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 --install-hook option doesn't work #45

Closed
asottile opened this issue Apr 3, 2021 · 6 comments
Closed

flake8 --install-hook option doesn't work #45

asottile opened this issue Apr 3, 2021 · 6 comments
Milestone

Comments

@asottile
Copy link
Member

asottile commented Apr 3, 2021

In GitLab by @nathan12343 on Sep 23, 2014, 10:32

When I try to create a flake8 commit hook in my mercurial repository, I get the following error:

$ flake8 --install-hook
Usage: flake8 [options] input ...

flake8: error: input not specified
$ flake8 --version
2.2.3 (pep8: 1.5.7, mccabe: 0.2.1, pyflakes: 0.8.1) CPython 2.7.8 on Linux

Weirdly, it seems to only happen for this one repository. I tried to debug this, but can't seem to find the place where the option parser is actually parsed.

@asottile asottile added this to the 2.2.4 milestone Apr 3, 2021
@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Sep 23, 2014, 19:12

I can reproduce this. Thanks for the report @nathan12343

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Sep 23, 2014, 20:33

So this is being triggered in pep8. I'm curious why we're only seeing this now.

I disabled multiprocessing to ensure it wasn't that. If there's a config file in the directory, it'll work just fine. I wonder when exactly this broke.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @jcwilson on Oct 6, 2014, 13:01

This is actually due to a larger issue of pep8 doing it's own option parsing which is being elided by flake8. For instance, [flake8] exclude patterns are not processed correctly for the internal pep8 delegation. flake8 sees it as a simple comma-delimited string while pep8 processes it into a list of exclude patterns. Since pep8 iterates over the exclude value when testing the patterns, it ends up comparing package and module names against the individual characters in the string passed from flake8, not the tokenized items that it expects to receive.

Should I open a separate issue for this?

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Oct 6, 2014, 13:42

@jcwilson can you rewrite that perhaps to be more coherent? As best I can tell your comment does not relate to this issue at all.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @jcwilson on Oct 6, 2014, 14:32

Sure, let me create another issue so as not to add more noise to this one. Sorry for the confusing write up.

@asottile
Copy link
Member Author

asottile commented Apr 3, 2021

In GitLab by @sigmavirus24 on Oct 9, 2014, 14:47

Thanks for reporting this @nathan12343. It should be fixed as of 7fd24c2 and the soon-to-be-released 2.2.4. Cheers!

@asottile asottile closed this as completed Apr 3, 2021
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

1 participant