-
-
Save pybites/929596b81b619ce3c115607d045af718 to your computer and use it in GitHub Desktop.
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.0.1 | |
hooks: | |
- id: check-yaml | |
- id: end-of-file-fixer | |
- id: trailing-whitespace | |
- id: debug-statements | |
- repo: https://github.com/pycqa/flake8 | |
rev: 3.9.2 | |
hooks: | |
- id: flake8 | |
additional_dependencies: ["flake8-bandit", "flake8-bugbear"] | |
- repo: https://github.com/pycqa/isort | |
rev: 5.9.3 | |
hooks: | |
- id: isort | |
args: ["--profile", "black", "--filter-files"] | |
- repo: https://github.com/psf/black | |
rev: 21.7b0 | |
hooks: | |
- id: black | |
language_version: python3 | |
- repo: https://github.com/asottile/pyupgrade | |
rev: v2.23.1 | |
hooks: | |
- id: pyupgrade |
So if I understand what this is, it checks your file formatting before you make a commit to your repo. I assume I can use poetry add
in place of pip to avoid conflicts? Should I implement this on the app we're collaborating on? (No rush to answer)
My installations failed when using:
https://gitlab.com/pycqa/flake8
Changing it to
https://github.com/pycqa/flake8
Fixed it
Also had to change isort to 5.12.0
Thanks, I updated the link in the gist. The versions are hard to keep up2date, but you can have precommit do it with its autoupdate
switch.
So if I understand what this is, it checks your file formatting before you make a commit to your repo. I assume I can use
poetry add
in place of pip to avoid conflicts? Should I implement this on the app we're collaborating on? (No rush to answer)
Yes, would be good to use on your project. What do you mean poetry vs pip to avoid conflicts? What kind of conflicts. You could add it as a dev dependency with poetry, seems -D is deprecated and you can use the group switch:
# poetry add docs:
-D, --dev Add as a development dependency. (Deprecated) Use --group=dev instead.
Might want to use ruff these days ...