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

Running via Flake8 pre-commit hook #13

Closed
jamestwebber opened this issue Nov 29, 2022 · 4 comments
Closed

Running via Flake8 pre-commit hook #13

jamestwebber opened this issue Nov 29, 2022 · 4 comments
Labels
fixed Fix for issue has been released.

Comments

@jamestwebber
Copy link
Contributor

Not sure if this is just user error, but thought I would mention it. I believe I had this working using the normal flake8 pre-commit hook, but it seems like a recent update somewhere changed things. When I tried to commit, it ran but ignored my config in pyproject.toml.

I am able to use this with the Flake8-pyproject hook in your README, so I'm good for now. But since the docs say that it should work with the normal hook I wanted to bring it to your attention.

Thanks for the package! 👍

@john-hen
Copy link
Owner

Hi James, thanks for bringing this up. Unfortunately, I cannot tell you if this is a user error, since I'm not using the pre-commit hook. The mention in the ReadMe was contributed by @ekalosak in #1. I don't see why the latest update (to Flake8 6.0.0) would break this, because the subsequent release of Flake8-pyproject did not even include any changes to the distributed code, only to the test suite and metadata. That is, you should now have Flake8 6.0.0 and Flake8-pyproject 1.2.1 installed if you upgraded everything (and are on Python 3.8 or higher).

@jamestwebber
Copy link
Contributor Author

Maybe @ekalosak or someone else can reproduce and/or confirm that it must be an error on my end. Everything is up to date, but something is unhappy now.

When I run pre-commit run --all-files with the normal flake8 hook it complains about things that it should ignore (e.g. E501 even though I've configured line length of 88).

@jamestwebber
Copy link
Contributor Author

Ah it was just user error: I didn't explicitly list Flake8-pyproject in my .pre-commit-config.yaml as a dependency for flake8, so it didn't install it in the venv it uses.

I could have sworn it worked okay before, but it's likely that I had only run things in my local environment and not in the venv that pre-commit creates for the hook.

I'll close this, but I will open a PR to clarify in the README which you can accept if you want.

@john-hen john-hen changed the title issues running via flake + pre-commit Running via Flake8 pre-commit hook Dec 4, 2022
@john-hen john-hen added the fixed Fix for issue has been released. label Dec 4, 2022
@ekalosak
Copy link
Contributor

ekalosak commented Feb 4, 2023

Sorry for being late on this @jamestwebber , looks like this was resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Fix for issue has been released.
Projects
None yet
Development

No branches or pull requests

3 participants