summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.rst
diff options
context:
space:
mode:
Diffstat (limited to 'CONTRIBUTING.rst')
-rw-r--r--CONTRIBUTING.rst42
1 files changed, 29 insertions, 13 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 04f010d..a7e9d2a 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -24,9 +24,9 @@ Ready to contribute? Here's how to set up CLI Helpers for local development.
$ pip install virtualenv
$ virtualenv cli_helpers_dev
- We've just created a virtual environment that we'll use to install all the dependencies
- and tools we need to work on CLI Helpers. Whenever you want to work on CLI Helpers, you
- need to activate the virtual environment::
+ We've just created a virtual environment called ``cli_helpers_dev``
+ that we'll use to install all the dependencies and tools we need to work on CLI Helpers.
+ Whenever you want to work on CLI Helpers, you need to activate the virtual environment::
$ source cli_helpers_dev/bin/activate
@@ -34,7 +34,7 @@ Ready to contribute? Here's how to set up CLI Helpers for local development.
$ deactivate
-5. Install the dependencies and development tools::
+5. From within the virtual environment, install the dependencies and development tools::
$ pip install -r requirements-dev.txt
$ pip install --editable .
@@ -43,11 +43,14 @@ Ready to contribute? Here's how to set up CLI Helpers for local development.
$ git checkout -b <name-of-bugfix-or-feature> master
-7. While you work on your bugfix or feature, be sure to pull the latest changes from ``upstream``. This ensures that your local codebase is up-to-date::
+7. While you work on your bugfix or feature, be sure to pull the latest changes from ``upstream``.
+ This ensures that your local codebase is up-to-date::
$ git pull upstream master
-8. When your work is ready for the CLI Helpers team to review it, push your branch to your fork::
+8. When your work is ready for the CLI Helpers team to review it,
+ make sure to add an entry to CHANGELOG file, and add your name to the AUTHORS file.
+ Then, push your branch to your fork::
$ git push origin <name-of-bugfix-or-feature>
@@ -77,18 +80,31 @@ You can also measure CLI Helper's test coverage by running::
Coding Style
------------
-CLI Helpers requires code submissions to adhere to
-`PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_.
-It's easy to check the style of your code, just run::
+When you submit a PR, the changeset is checked for pep8 compliance using
+`black <https://github.com/psf/black>`_. If you see a build failing because
+of these checks, install ``black`` and apply style fixes:
- $ pep8radius master
+::
-If you see any PEP 8 style issues, you can automatically fix them by running::
+ $ pip install black
+ $ black .
- $ pep8radius master --in-place
+Then commit and push the fixes.
-Be sure to commit and push any PEP 8 fixes.
+To enforce ``black`` applied on every commit, we also suggest installing ``pre-commit`` and
+using the ``pre-commit`` hooks available in this repo:
+::
+
+ $ pip install pre-commit
+ $ pre-commit install
+
+Git blame
+---------
+
+Use ``git blame my_file.py --ignore-revs-file .git-blame-ignore-revs`` to exclude irrelevant commits
+(specifically Black) from ``git blame``. For more information,
+see `here <https://github.com/psf/black#migrating-your-code-style-without-ruining-git-blame>`_.
Documentation
-------------