Skip to content
Myr

Add pre-commit to dev dependencies, document it and pre-commit in CONTRIBUTING

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Now that we have a Black pre-commit hook (#3138), ensure pre-commit gets installed on ``pip install -e .[dev]`` and document use of Black (rather than "try to follow pep8") in CONTRIBUTING.

authored by jab · committed by jab · parent d3e1fed · Browse files · 2 files+7 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−5 removed

  • other:+7 added−5 removed

2 files+7 added−5 removed

modified:CONTRIBUTING.rst+6 added-5 removed
35 unmodified lines
3637Submitting patches38------------------3940- Use `Black`_ to autoformat your code. This should be done for you as a41 git `pre-commit`_ hook, which gets installed when you run ``pip install -e .[dev]``.42 You may also wish to use Black's `Editor integration`_.43- Include tests if your patch is supposed to solve a bug, and explain44 clearly under which circumstances the bug happens. Make sure the test fails45 without your patch.43- Try to follow `PEP8`_, but you may ignore the line length limit if following44 it would make the code uglier.4647First time setup48~~~~~~~~~~~~~~~~49
46 unmodified lines
9697 git checkout -b your-branch-name origin/master9899- Using your favorite editor, make your changes, `committing as you go`_.99- Try to follow `PEP8`_, but you may ignore the line length limit if following100 it would make the code uglier.100- Include tests that cover any code changes you make. Make sure the test fails101 without your patch. `Run the tests. <contributing-testsuite_>`_.102- Push your commits to GitHub and `create a pull request`_ by using::103
1 unmodified line
105106- Celebrate 🎉107108.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes110.. _PEP8: https://pep8.org/109.. _Black: https://black.readthedocs.io110.. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html111.. _pre-commit: https://pre-commit.com112.. _create a pull request: https://help.github.com/articles/creating-a-pull-request/113114.. _contributing-testsuite:115
81 unmodified lines
modified:setup.py+1 added
48 unmodified lines
49 "tox",50 "sphinx",51 "pallets-sphinx-themes",52 "sphinxcontrib-log-cabinet",53 "pre-commit",54 ],55 "docs": ["sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet"],56 },57 classifiers=[
21 unmodified lines