Add Black to pre-commit#361
Conversation
Signed-off-by: Erik Wrede <erikwrede2@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #361 +/- ##
=======================================
Coverage 96.50% 96.50%
=======================================
Files 9 9
Lines 801 801
=======================================
Hits 773 773
Misses 28 28
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
sabard
left a comment
There was a problem hiding this comment.
Possible to change:
default_language_version:
python: python3.10to
default_language_version:
python: python3in .pre-commit-config.yaml? I'm using Python3.8 now and I can't lint without that. I'd make the change, but don't have access to your repo.
The other comments here are just my preference; let me know what you think. Otherwise looks great.
.flake8
Outdated
| [flake8] | ||
| ignore = E203,W503 | ||
| exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs | ||
| exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs,setup.py,docs/*,examples/*,tests |
There was a problem hiding this comment.
Any reason that flake8 should not be run for docs, tests, and examples? When I ran it myself on these it caught a couple import things that should be fixed.
.flake8
Outdated
| ignore = E203,W503 | ||
| exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs | ||
| exclude = .git,.mypy_cache,.pytest_cache,.tox,.venv,__pycache__,build,dist,docs,setup.py,docs/*,examples/*,tests | ||
| max-line-length = 120 |
There was a problem hiding this comment.
nit: If we're changing things here, can we set max-line-length to 79 as per PEP-8? Or maybe there's a good reason for 120?
| [aliases] | ||
| test=pytest | ||
|
|
||
| [flake8] |
There was a problem hiding this comment.
Why don't we put all flake8 config here instead of having a separate file?
Adds black to pre-commit to ensure a consistent code style over all future contributions