From aae0d87028d06fa8b52a4a4f2e668010b5272292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 5 May 2024 13:38:44 -0400 Subject: [PATCH] DOC: Document the coding style enforcement framework Add a coding style section to the documentation to reflect the use of the `pre-commit` and `ruff`-based style enforcement framework. --- docs/source/installation.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index d5f6b5957..34c0e573c 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -136,6 +136,34 @@ Since Xvfb will require an X server (we also recommend to install XQuartz packag export DISPLAY=:0 xvfb-run --server-args="-screen 0 1920x1080x24" pytest -svv fury +Coding style +------------ + +FURY uses the standard Python `PEP8 `_ +style to ensure the readability and consistency across the toolkit. FURY has +adopted an automated style checking framework that uses `pre-commit `_ +and `ruff `_. Style conformance rules are +specified in the ``ruff.toml`` configuration file. When requesting to push to +FURY, the compliance to the set of rules is automatically checked using a +GitHub Actions workflow. + +In order to check the compliance locally, developers should install the +``[style]`` dependencies: + +.. code-block:: shell + + pip install -e .[style] + +The git hook scripts need to be installed then running: + +.. code-block:: shell + + pre-commit install + +``pre-commit`` will then run automatically on ``git commit``. + +Most text editors can be configured to check the compliance of your code with +the set of rules specified in the ``ruff.toml`` file. Populating our Documentation ----------------------------