Skip to content

Commit 50c6fa9

Browse files
authored
Merge pull request #20247 from anntzer/white
Explicitly reject black autoformatting.
2 parents de2ea8b + 64f5434 commit 50c6fa9

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

doc/devel/contributing.rst

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,31 @@ rules before submitting a pull request:
160160
appropriate. Use the `numpy docstring standard
161161
<https://numpydoc.readthedocs.io/en/latest/format.html>`_.
162162

163-
* Formatting should follow the recommendations of `PEP8
164-
<https://www.python.org/dev/peps/pep-0008/>`__. You should consider
165-
installing/enabling automatic PEP8 checking in your editor. Part of the test
166-
suite is checking PEP8 compliance, things go smoother if the code is mostly
167-
PEP8 compliant to begin with.
163+
* Formatting should follow the recommendations of PEP8_, as enforced by
164+
flake8_. You can check flake8 compliance from the command line with ::
165+
166+
python -m pip install flake8
167+
flake8 /path/to/module.py
168+
169+
or your editor may provide integration with it. Note that Matplotlib
170+
intentionally does not use the black_ auto-formatter (1__), in particular due
171+
to its unability to understand the semantics of mathematical expressions
172+
(2__, 3__).
173+
174+
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
175+
.. _flake8: https://flake8.pycqa.org/
176+
.. _black: https://black.readthedocs.io/
177+
.. __: https://github.com/matplotlib/matplotlib/issues/18796
178+
.. __: https://github.com/psf/black/issues/148
179+
.. __: https://github.com/psf/black/issues/1984
168180

169181
* Each high-level plotting function should have a simple example in the
170182
``Example`` section of the docstring. This should be as simple as possible
171183
to demonstrate the method. More complex examples should go in the
172184
``examples`` tree.
173185

174-
* Changes (both new features and bugfixes) should be tested. See :ref:`testing`
175-
for more details.
186+
* Changes (both new features and bugfixes) should have good test coverage. See
187+
:ref:`testing` for more details.
176188

177189
* Import the following modules using the standard scipy conventions::
178190

@@ -201,19 +213,6 @@ rules before submitting a pull request:
201213
* See below for additional points about :ref:`keyword-argument-processing`, if
202214
applicable for your pull request.
203215

204-
In addition, you can check for common programming errors with the following
205-
tools:
206-
207-
* Code with a good unittest coverage (at least 70%, better 100%), check with::
208-
209-
python -m pip install coverage
210-
python -m pytest --cov=matplotlib --showlocals -v
211-
212-
* No pyflakes warnings, check with::
213-
214-
python -m pip install pyflakes
215-
pyflakes path/to/module.py
216-
217216
.. note::
218217

219218
The current state of the Matplotlib code base is not compliant with all

0 commit comments

Comments
 (0)