-
Notifications
You must be signed in to change notification settings - Fork 301
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
@@ 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.
|
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 '\n\033[0;31m dont forget to source env/bin/activate\033[0m\n'
|
||
To run tests clone the repository, and then: | ||
|
||
# Setup the virtual environment |
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