Skip to content
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

Add note about setting up pre-commit #243

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion doc/getting_started/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,25 @@ main repository (see `Larger changes <#Larger-changes>`_ below).
Once you have the code, you will need to install Refl1D, including its dependencies.
You can do this by following the instructions in the `Installation guide <install.html>`_.

.. simple-patches:
Making Changes
==============

Pre-commit hooks
----------------

Once you have installed the code with ``pip install -e .[dev]``, you can make changes to the code. Note that refl1d uses `pre-commit <https://pre-commit.com/>`_ to run automated checks and linting/formatting on the code before it is committed.

First, activate the Python environment in which you installed refl1d. Then, install the pre-commit hooks by running::

pre-commit install

This will install the pre-commit hooks in your git repository. The pre-commit hooks will run every time you commit changes to the repository. If the checks fail, the commit will be aborted.

You can run the checks manually by running::

pre-commit run

To see what actions are being run, inspect the `.pre-commit-config.yaml` file in the root of the repository.

Simple patches
--------------
Expand Down
Loading