-
Notifications
You must be signed in to change notification settings - Fork 298
Introduce pre-commit to simplify contributions #866
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
Conversation
Codecov Report
Merging #866 (80fa5f4) into master (c356806) will not change coverage.
The diff coverage isn/a
.
@@ Coverage Diff @@ ## master #866 +/- ## ======================================= Coverage 97.74% 97.74% ======================================= Files 60 60 Lines 3319 3319 ======================================= Hits 3244 3244 Misses 75 75
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update c356806...80fa5f4. Read the comment docs.
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.
Consider adding something like the following to tox.ini as a mean of making it easy for someone to set up the venv:
[testenv:devenv]
envdir = env
basepython = python3.6
usedevelop = True
deps =
-rrequirements.txt
commands =
/usr/bin/printf '\n033円[0;31m dont forget to source env/bin/activate033円[0m\n'
176de92
to
80fa5f4
Compare
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.
@sliverc my point of tox -e devenv
is you can turn these several steps into one.
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.
The tox -e devenv stuff can wait for another PR if you see the value of it.
Fixes #861
Description of the Change
Add pre-commit for editor independent checking of linting and formatting of code before committing changes to git.
I have added a pre-commit configuration which uses the locally resp. in the virtual environment installed version of flake8, isort and black. pre-commit also has a way of handling the installation of such tools. However PyUp cannot update those version references and we might end up with different version in pre-commit and requirements.txt which we should avoid.
The only down side to run tools locally is that a virtual env needs to be activated before committing. This needs to be the case anyway to run tests.
Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS