Skip to content

Commit

Permalink
DOCS: Add ruff section to the dev guide docs (#5701)
Browse files Browse the repository at this point in the history
* added ruff section to the dev guide docs.

* added whatsnew

* Update docs/src/developers_guide/contributing_ci_tests.rst

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>

* Update docs/src/developers_guide/contributing_ci_tests.rst

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>

* Update docs/src/developers_guide/contributing_ci_tests.rst

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>

* Update docs/src/developers_guide/contributing_ci_tests.rst

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>

---------

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>
  • Loading branch information
tkknight and bjlittle authored Jan 24, 2024
1 parent adca725 commit b828ffd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 29 additions & 2 deletions docs/src/developers_guide/contributing_ci_tests.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _developer_testing_ci:

.. include:: ../common_links.inc

.. _developer_testing_ci:

Continuous Integration (CI) Testing
===================================

Expand Down Expand Up @@ -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/
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
===========
Expand Down

0 comments on commit b828ffd

Please sign in to comment.