Skip to content

Commit efc6548

Browse files
committed
Update docs regarding pre-commit and ruff. [ci skip]
1 parent 31acf21 commit efc6548

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

doc/source/contributing/codestyle.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ and now has a fully `PEP8-compliant <https://pep8.org>`__ API. We indent to
5353
move BioSimSpace towards using Python compliant API too, while preserving backwards
5454
compatibility.)
5555

56-
We use `black <https://black.readthedocs.io/en/stable>`__ to autoformat our
57-
Python code. Please use this if you plan on submitting code. They are easy to
58-
configure and use via your IDE (or from the command-line) and help ensure a
59-
consistent code style and minimise diffs during pull requests.
56+
We use `ruff <https://docs.astral.sh/ruff>`__ to format and lint our Python
57+
code. This is run automatically via `pre-commit <https://pre-commit.com>`__
58+
hooks when you commit changes. See the :doc:`development` guide for setup
59+
instructions.
6060

6161
Modules
6262
-------

doc/source/contributing/development.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,31 @@ Now create and switch to a feature branch. This should be prefixed with
185185
git checkout -b feature-process
186186
187187
While working on your feature branch you won't want to continually re-install
188-
in order to make the changes active. To avoid this, you can either make use
189-
of ``PYTHONPATH``, e.g.
188+
in order to make the changes active. To avoid this, install the package in
189+
editable mode:
190190

191191
.. code-block:: bash
192192
193-
PYTHONPATH=$HOME/Code/BioSimSpace/python python script.py
193+
pip install -e .
194194
195-
or use the ``develop`` argument when running the ``setup.py`` script, i.e.
195+
Pre-commit hooks
196+
----------------
197+
198+
Pre-commit hooks are used to ensure consistent code formatting and linting.
199+
To set up pre-commit in your development environment:
200+
201+
.. code-block:: bash
202+
203+
pixi shell -e dev
204+
pre-commit install
205+
206+
This will run `ruff <https://docs.astral.sh/ruff/>`__ formatting and linting
207+
checks automatically on each commit. To run the checks manually against all
208+
files:
196209

197210
.. code-block:: bash
198211
199-
python setup.py develop
212+
pre-commit run --all-files
200213
201214
Testing
202215
-------

0 commit comments

Comments
 (0)