@@ -15,22 +15,28 @@ consistency, and maintainability of the code base.
1515
1616.. _code-style :
1717
18- PEP8, as enforced by flake8
19- ===========================
18+ PEP8, as enforced by ruff
19+ =========================
2020
21- Formatting should follow the recommendations of PEP8 _, as enforced by flake8 _ .
21+ Formatting should follow the recommendations of PEP8 _, as enforced by ruff _ .
2222Matplotlib modifies PEP8 to extend the maximum line length to 88
23- characters. You can check flake8 compliance from the command line with ::
23+ characters. You can check PEP8 compliance from the command line with ::
24+
25+ python -m pip install ruff
26+ ruff check /path/to/module.py
27+
28+ or your editor may provide integration with it. To check all files,
29+ and fix any errors in-place (where possible) run ::
30+
31+ ruff check --fix
2432
25- python -m pip install flake8
26- flake8 /path/to/module.py
2733
28- or your editor may provide integration with it. Note that Matplotlib intentionally
29- does not use the black _ auto-formatter ( 1 __), in particular due to its inability
30- to understand the semantics of mathematical expressions (2 __, 3 __).
34+ Matplotlib intentionally does not use the black _ auto-formatter ( 1 __),
35+ in particular due to its inability to understand the semantics of
36+ mathematical expressions (2 __, 3 __).
3137
3238.. _PEP8 : https://www.python.org/dev/peps/pep-0008/
33- .. _ flake8 : https://flake8.pycqa.org /
39+ .. _ ruff : https://docs.astral.sh/ruff /
3440.. _black : https://black.readthedocs.io/
3541.. __ : https://github.com/matplotlib/matplotlib/issues/18796
3642.. __ : https://github.com/psf/black/issues/148
0 commit comments