-
Notifications
You must be signed in to change notification settings - Fork 227
Add Black to pre-commit #361
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
Add Black to pre-commit #361
Conversation
Signed-off-by: Erik Wrede <[email protected]>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to change:
default_language_version:
python: python3.10
to
default_language_version:
python: python3
in .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
@@ -1,4 +1,4 @@ | |||
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -1,4 +1,4 @@ | |||
[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 | |||
max-line-length = 120 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -1,11 +1,8 @@ | |||
[aliases] | |||
test=pytest | |||
|
|||
[flake8] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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