Skip to content

Commit

Permalink
update docs to include info on pre-commits
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelquast committed Nov 23, 2023
1 parent cd36a0c commit 48d90a3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/contribution_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,34 @@ To do so, first clone the `GitHub repository <https://github.com/TUW-GEO/rt1_mod
pip install -e .
That's it! You're all set!

Once you're done with coding, head over to `GitHub <https://github.com/TUW-GEO/rt1_model>`_, and open a new `Pull Request <https://github.com/TUW-GEO/rt1_model/pulls>`_
to start discussions and get help!


Code formatting
~~~~~~~~~~~~~~~

The ``rt1_model`` package uses the `black code-style <https://github.com/psf/black>`_ and `pre-commits <https://pre-commit.com/>`_ to ensure code-formatting for changes pushed to GitHub.

To initialize pre-commits, execute the following command (again in the parent-directory containing the ``.pre-commit-config.yaml`` file.

.. code-block:: console
pre-commit install
Now pre-commit is run prior to pushing commits to GitHub and `black <https://github.com/psf/black>`_ code-formatting is
applied to all staged files.

You can also manually run pre-commit on all files by executing:

.. code-block:: console
pre-commit run --all-files
.. note::

You must stage all changes performed by the automatic re-formatting prior to pushing to GitHub!
3 changes: 3 additions & 0 deletions docs/rt1_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dependencies:
- matplotlib >=3.8
- python-symengine

# ---------- to run pre commits
- pre-commit

# ---------- for testing
- pytest
- pytest-cov
Expand Down

0 comments on commit 48d90a3

Please sign in to comment.