Skip to content

Commit

Permalink
DOC: Add pre-commit section to docs (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 authored Jan 10, 2024
1 parent 3b3418f commit 0c5017a
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,39 +83,17 @@ Git:
Code Style
----------

Py-ART follows pep8 coding standards. To make sure your code follows the
pep8 style, you can use a variety of tools that can check for you. Two
popular pep8 check modules are pycodestyle and pylint.
Py-ART uses pre-commit for linting, which applies a variety of pep8 and other code style rules.

For more on pep8 style:

- https://www.python.org/dev/peps/pep-0008/

To install pycodestyle::
To install pre-commit hooks for the Py-ART repo::

conda install pycodestyle
pre-commit install

To use pycodestyle::

pycodestyle filename

To install pylint::

conda install pylint

To get a detailed pylint report::

pylint filename

If you want to just see what line number and the issue, just use::

pylint -r n filename

Both of these tools are highly configurable to suit a user's taste. Refer to
the tools documentation for details on this process.

- https://pycodestyle.readthedocs.io/en/latest/
- https://www.pylint.org/
Afterwards, pre-commit will run on every commit to the repository. It will re-format files as neccessary.


Python File Setup
Expand Down

0 comments on commit 0c5017a

Please sign in to comment.