Closed MartinGrignard closed 3 years ago
Sorry for the auto-reply, but if someone comes across the same issue, here is a configuration that works. The problem was that the hook used the flake8
command and not pflake8
:
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
entry: pflake8
additional_dependencies: [pyproject-flake8]
Indeed someone else may need such a clarification, I'll see if I'll add a section to the README how to use pflake8 with pre-commit.
I just saw that the repository includes a pre-commit hook so my solution might not be the recommended one. Thanks :slightly_smiling_face:
Thank you @MartinGrignard. I was having the same problem. I don't know whether this clarification should be added to REDME, but I needed it.
I just saw that the repository includes a pre-commit hook so my solution might not be the recommended one. Thanks 🙂
I still like the above configuration because the version of flake8
is explicitly fixed (while the pre-commit hook in the repository does not specify the version of flake8
; probably the latest one will be used, which potentially leads to some incompatibility in future).
Probably obvious to most, Â but something I just ran into after setting this up on a new project.
If you're using vscode in WSL and you get the error saying it cant find pflake8 when you do a commit, then  you need to start vscode from inside your poetry venv.
Hi :slightly_smiling_face:
Thanks for this nice addition to the
flake8
ecosystem! I'm currently working on a project relying onpre-commit-config.yaml
to insure consistency in the code style.Since the default commit hook does not include your package, I tried using the method described here:
My config for
flake8
inpyproject.toml
is:Yet, when running the commit hook, I get:
This means that the configuration is not parsed properly from the
pyproject.toml
. Do you have any idea to solve this?Thanks :slightly_smiling_face: