john-hen / Flake8-pyproject

Flake8 plug-in loading the configuration from pyproject.toml
https://pypi.org/project/Flake8-pyproject
MIT License
218 stars 10 forks source link

Running via Flake8 pre-commit hook #13

Closed jamestwebber closed 1 year ago

jamestwebber commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

ekalosak commented 1 year ago

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