From f36cd3794f1b5079e528abfc0e6bf393a756927b Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:49:29 +0000 Subject: [PATCH 1/6] added ruff section to the dev guide docs. --- .../contributing_ci_tests.rst | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index bfe80cd760..fa592c5fb3 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -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. rruff is configured in the `Iris`_ GitHub repository using +`.pre-commit-config.yaml`_. + +You can install and run `ruff`_ into 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 add any rules to ignore if appropriate. We + aim to be ruff compliant where at all 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/ From a2c832d2b8fb11dfb8a734f28bd50d8174bbf135 Mon Sep 17 00:00:00 2001 From: Tremain Knight <2108488+tkknight@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:13:50 +0000 Subject: [PATCH 2/6] added whatsnew --- docs/src/developers_guide/contributing_ci_tests.rst | 4 ++-- docs/src/whatsnew/latest.rst | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index fa592c5fb3..0629dc15e1 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 =================================== diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index dfc1019683..0d9bec6f18 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -157,6 +157,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 =========== From 5bea33827f4a0684ce7d3f54d085b8fafefbf0b0 Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:22:01 +0000 Subject: [PATCH 3/6] Update docs/src/developers_guide/contributing_ci_tests.rst Co-authored-by: Bill Little --- docs/src/developers_guide/contributing_ci_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index 0629dc15e1..f617bb03e1 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -122,7 +122,7 @@ See the `pre-commit.ci dashboard`_ for details of recent past and active Iris jo ruff ---- As of **Iris 3.8** `ruff`_ has been adopted to ensure our codebase is using best -practice. rruff is configured in the `Iris`_ GitHub repository using +practice. `ruff`_ is configured in the `Iris`_ GitHub repository using `.pre-commit-config.yaml`_. You can install and run `ruff`_ into your development **iris-dev** conda environment From d410107cf007e6fcd35953e12251b2dd560aef02 Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:22:10 +0000 Subject: [PATCH 4/6] Update docs/src/developers_guide/contributing_ci_tests.rst Co-authored-by: Bill Little --- docs/src/developers_guide/contributing_ci_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index f617bb03e1..5088447830 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -125,7 +125,7 @@ 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`_ into your development **iris-dev** conda environment +You can install and run `ruff`_ in your development **iris-dev** conda environment via:: conda activate iris-dev From bc79ea4784e54ca8b000dacce51bf6ce78ad2728 Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:22:21 +0000 Subject: [PATCH 5/6] Update docs/src/developers_guide/contributing_ci_tests.rst Co-authored-by: Bill Little --- docs/src/developers_guide/contributing_ci_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index 5088447830..55947a3e66 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -140,7 +140,7 @@ via:: of the ``pyproject.toml`` file. Edit the ``.ruff.toml`` file to add any rules to ignore if appropriate. We - aim to be ruff compliant where at all possible. + aim to be fully `ruff`_ compliant as possible. For more information on how to use `ruff`_ please see the `ruff documentation`_. From 3f3973a060c0452f03d36da96e401a21323817ba Mon Sep 17 00:00:00 2001 From: tkknight <2108488+tkknight@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:22:38 +0000 Subject: [PATCH 6/6] Update docs/src/developers_guide/contributing_ci_tests.rst Co-authored-by: Bill Little --- docs/src/developers_guide/contributing_ci_tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/developers_guide/contributing_ci_tests.rst b/docs/src/developers_guide/contributing_ci_tests.rst index 55947a3e66..799e3fc1c0 100644 --- a/docs/src/developers_guide/contributing_ci_tests.rst +++ b/docs/src/developers_guide/contributing_ci_tests.rst @@ -139,7 +139,7 @@ via:: This hook is configured in the ``[tool.ruff]`` section of the ``pyproject.toml`` file. - Edit the ``.ruff.toml`` file to add any rules to ignore if appropriate. We + 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`_.