diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index bfe80cd760..799e3fc1c0 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -1,7 +1,7 @@ -.. _developer_testing_ci: - .. include:: ../common_links.inc +.. _developer_testing_ci: + Continuous Integration (CI) Testing =================================== @@ -119,5 +119,32 @@ See the `pre-commit.ci dashboard`_ for details of recent past and active Iris jo Append to the ``ignore-words-list`` option any **valid words** that are considered **not** a typo and should **not** be corrected by `codespell`_. +ruff +---- +As of **Iris 3.8** `ruff`_ has been adopted to ensure our codebase is using best +practice. `ruff`_ is configured in the `Iris`_ GitHub repository using +`.pre-commit-config.yaml`_. + +You can install and run `ruff`_ in your development **iris-dev** conda environment +via:: + + conda activate iris-dev + pip install ruff + cd iris + ruff . + +.. note:: + + The `ruff`_ ``pre-commit`` hook checks for compliance of the whole codebase. + This hook is configured in the ``[tool.ruff]`` section + of the ``pyproject.toml`` file. + + Edit the ``.ruff.toml`` file to include any *temporary* rules to be ignored. Edit the ``pyproject.toml`` to include any *permanent* rules to be ignored. We + aim to be fully `ruff`_ compliant as possible. + +For more information on how to use `ruff`_ please see the `ruff documentation`_. + + .. _.pre-commit-config.yaml: https://github.com/SciTools/iris/blob/main/.pre-commit-config.yaml .. _pre-commit.ci dashboard: https://results.pre-commit.ci/repo/github/5312648 +.. _ruff documentation: https://docs.astral.sh/ruff/tutorial/ diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 831f24bfab..dc661f5738 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -169,6 +169,9 @@ This document explains the changes made to Iris for this release :class:`~iris.cube.Cube` standard names in :func:`iris.analysis.calculus.curl`. (:pull:`5680`) +#. `@tkknight`_ added ruff documentation in the :ref:`developer_testing_ci` of the + :ref:`developers_guide`. (:pull:`5701`) + 💼 Internal ===========