10000 Merge pull request #22809 from matthewfeickert/mnt/apply-pre-commit-t… · matplotlib/matplotlib@f569f21 · GitHub
[go: up one dir, main page]

Skip to content

Commit f569f21

Browse files
authored
Merge pull request #22809 from matthewfeickert/mnt/apply-pre-commit-to-all-files
STY: Apply pre-commit hooks to codebase
2 parents 02e123a + 48ade7d commit f569f21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+123
-123
lines changed

.git-blame-ignore-revs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# style: end-of-file-fixer pre-commit hook
2+
c1a33a481b9c2df605bcb9bef9c19fe65c3dac21
3+
4+
# style: trailing-whitespace pre-commit hook
5+
213061c0804530d04bbbd5c259f10dc8504e5b2b
6+
7+
# style: check-docstring-first pre-commit hook
8+
046533797725293dfc2a6edb9f536b25f08aa636

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ body:
66
id: summary
77
attributes:
88
label: Bug summary
9-
description: Describe the bug in 1-2 short sentences
10-
placeholder:
9+
description: Describe the bug in 1-2 short sentences
10+
placeholder:
1111
value:
1212
validations:
1313
required: true
1414
- type: textarea
1515
id: reproduction
1616
attributes:
1717
label: Code for reproduction
18-
description: If possible, please provide a minimum self-contained example.
18+
description: If possible, please provide a minimum self-contained example.
1919
placeholder: Paste your code here
2020
render: python
2121
validations:
@@ -59,7 +59,7 @@ body:
5959
required: true
6060
- type: input
6161
id: matplotlib-backend
62-
attributes:
62+
attributes:
6363
label: Matplotlib Backend
6464
description: "From Python prompt: `import matplotlib; print(matplotlib.get_backend())`"
6565
- type: input

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body:
1515
id: problem
1616
attributes:
1717
label: Problem
18-
description: What is missing, unclear, or wrong in the documentation?
18+
description: What is missing, unclear, or wrong in the documentation?
1919
placeholder: |
2020
* I found [...] to be unclear because [...]
2121
* [...] made me think that [...] when really it should be [...]

.github/ISSUE_TEMPLATE/maintenance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ body:
77
id: summary
88
attributes:
99
label: Summary
10-
description: Please provide 1-2 short sentences that succinctly describes what could be improved.
10+
description: Please provide 1-2 short sentences that succinctly describes what could be improved.
1111
validations:
1212
required: true
1313
- type: textarea
1414
id: fix
1515
attributes:
1616
label: Proposed fix
17-
description: Please describe how you think this could be improved.
17+
description: Please describe how you think this could be improved.

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@ jobs:
305305
pinned: false
306306
close-previous: false
307307
env:
308-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
308+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ci:
44
exclude: |
55
(?x)^(
66
extern|
7+
LICENSE|
78
lib/matplotlib/mpl-data|
89
doc/devel/gitwash|
910
doc/users/prev|
@@ -12,7 +13,7 @@ exclude: |
1213
)
1314
repos:
1415
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.0.1
16+
rev: v4.2.0
1617
hooks:
1718
- id: check-added-large-files
1819
- id: check-docstring-first
@@ -22,7 +23,7 @@ repos:
2223
- id: trailing-whitespace
2324
exclude_types: [svg]
2425
- repo: https://github.com/pycqa/flake8
25-
rev: 3.9.2
26+
rev: 4.0.1
2627
hooks:
2728
- id: flake8
2829
additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0]

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ representative at an online or offline event.
6262
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6363
reported to the community leaders responsible for enforcement at
6464
matplotlib@numfocus.org (monitored by Thomas Caswell (\@tacaswell) and Hannah
65-
Aizenman (\@story645)) or a report can be made using the [NumFOCUS Code of Conduct report form][numfocus form].
65+
Aizenman (\@story645)) or a report can be made using the [NumFOCUS Code of Conduct report form][numfocus form].
6666
If community leaders cannot come to a resolution about enforcement, reports will be escalated to the NumFocus Code of Conduct committee (conduct@numfocus.org).
6767
All complaints will be reviewed and investigated promptly and fairly.
6868

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,3 @@ For more information, please visit `the informational page
116116
<https://sustainable-open-science-and-software.github.io/>`__ or download the
117117
`participant information sheet
118118
<https://sustainable-open-science-and-software.github.io/assets/PIS_sustainable_software.pdf>`__.
119-

doc/README.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ This is the top level build directory for the Matplotlib
1313
documentation. All of the documentation is written using sphinx, a
1414
python documentation system built on top of ReST. This directory contains
1515

16-
* users - the user documentation, e.g., installation, plotting tutorials,
16+
* users - the user documentation, e.g., installation, plotting tutorials,
1717
configuration tips, faq, explaations, etc.
1818

1919
* devel - documentation for Matplotlib developers
2020

2121
* api - placeholders to automatically generate the api documentation
2222

23-
* tutorials, plot_types, and gallery - automatically
23+
* tutorials, plot_types, and gallery - automatically
2424
generated by sphinx-gallery from ``../tutorials``, ``../plot_types``, and
2525
``../examples`` respectively (these are only present if docs have been
26-
built locally).
26+
built locally).
2727

2828
* thirdpartypackages - redirect to <https://matplotlib.org/mpl-third-party/>
2929

doc/_static/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ contour_frontpage.png
22
histogram_frontpage.png
33
membrane_frontpage.png
44
surface3d_frontpage.png
5-

doc/_static/switcher.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
"name": "2.2",
2020
"version": "2.2.4"
2121
},
22-
]
22+
]

doc/_templates/automodule.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
treat this separately (sphinx-doc/sphinx/issues/4874)
66
.. automodule:: {{ fullname }}
77
:members:
8-
8+
99
{% else %}
1010

1111
.. automodule:: {{ fullname }}
@@ -18,7 +18,7 @@
1818
Classes
1919
-------
2020

21-
.. autosummary::
21+
.. autosummary::
2222
:template: autosummary.rst
2323
:toctree:
2424
{% for item in classes %}{% if item not in ['zip', 'map', 'reduce'] %}
@@ -32,7 +32,7 @@ Classes
3232
Functions
3333
---------
3434

35-
.. autosummary::
35+
.. autosummary::
3636
:template: autosummary.rst
3737
:toctree:
3838

doc/api/_enums_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
.. autoclass:: CapStyle
1313
:members: demo
1414
:exclude-members: butt, round, projecting, input_description
15-

doc/api/lines_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ Functions
2626
:template: autosummary.rst
2727

2828
segment_hits
29-

doc/api/next_api_changes/behavior/00001-ABC.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Behavior Change template
44
Enter description here....
55

66
Please rename file with PR number and your initials i.e. "99999-ABC.rst"
7-
and ``git add`` the new file.
7+
and ``git add`` the new file.

doc/api/next_api_changes/behavior/22639-RA.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ MacOSX backend to use sRGB instead of GenericRGB colorspace
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
MacOSX backend now display sRGB tagged image instead of GenericRGB which is
44
an older (now deprecated) Apple colorspace. This is the source colorspace
5-
used by ColorSync to convert to the current display profile.
5+
used by ColorSync to convert to the current display profile.

doc/api/next_api_changes/behavior/22691-JMK.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ QuadMesh mouseover defaults to False
33

44
New in 3.5, `.QuadMesh.get_cursor_data` allows display of data values
55
under the cursor. However, this can be very slow for large meshes, so
6-
by `.QuadMesh.set_mouseover` defaults to *False*.
6+
by `.QuadMesh.set_mouseover` defaults to *False*.

doc/api/next_api_changes/deprecations/22133-OG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
The modules ``matplotlib.AFM``, ``matplotlib.configfont_pattern``, and
55
``matplotlib.Type1Font`` are considered internal and public access is
6-
deprecated.
6+
deprecated.

doc/api/next_api_changes/deprecations/22134-OG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Modules ``tight_bbox`` and ``tight_layout`` deprecated
22
------------------------------------------------------
33

44
The modules ``matplotlib.tight_bbox`` and ``matplotlib.tight_layout`` are
5-
considered internal and public access is deprecated.
5+
considered internal and public access is deprecated.

doc/api/next_api_changes/deprecations/22268-OG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ is deprecated.
77

88
For ``is_close_to_int`` use ``math.isclose(x, round(x))`` instead.
99
For ``is_decade`` use
10-
``y = numpy.log(x)/numpy.log(base); numpy.isclose(y, numpy.round(y))``
10+
``y = numpy.log(x)/numpy.log(base); numpy.isclose(y, numpy.round(y))``

doc/api/next_api_changes/deprecations/22345-JK.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ The methods `~.Figure.set_constrained_layout_pads` and
1111
`~.Figure.get_constrained_layout_pads` are will be deprecated in favor of
1212
``figure.get_layout_engine().set()`` and
1313
``figure.get_layout_engine().get()``, and currently emit a
14-
``PendingDeprecationWarning``.
14+
``PendingDeprecationWarning``.

doc/api/next_api_changes/development/00001-ABC.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Development Change template
44
Enter description here....
55

66
Please rename file with PR number and your initials i.e. "99999-ABC.rst"
7-
and ``git add`` the new file.
7+
and ``git add`` the new file.

doc/api/next_api_changes/development/22205-ES.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ being bumped:
1313

1414
This is consistent with our :ref:`min_deps_policy` and `NEP29
1515
<https://numpy.org/neps/nep-0029-deprecation_policy.html>`__
16-

doc/api/next_api_changes/removals/00001-ABC.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Removal Change template
44
Enter description of methods/classes removed here....
55

66
Please rename file with PR number and your initials i.e. "99999-ABC.rst"
7-
and ``git add`` the new file.
7+
and ``git add`` the new file.

doc/api/next_api_changes/removals/21980-CC.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Removed loaded modules logging
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
The list of currently loaded modules is no longer logged at the DEBUG level at Matplotlib import time,
5-
because it can produce extensive output and make other valuable DEBUG statements difficult to find.
6-
If you were relying on this please arrange for your own logging (the built-in `sys.modules` can be used to get the currently loaded modules).
5+
because it can produce extensive output and make other valuable DEBUG statements difficult to find.
6+
If you were relying on this please arrange for your own logging (the built-in `sys.modules` can be used to get the currently loaded modules).

doc/api/next_api_changes/removals/22516-OG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ be used as a replacement.
1717

1818
In the WX backend, the property ``IDLE_DELAY`` is removed. In addition, the
1919
parameter ``origin`` of ``gui_repaint()`` is removed, as well as the method
20-
``get_canvas()``. No replacements are provided.
20+
``get_canvas()``. No replacements are provided.

doc/api/patches_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ Functions
4848

4949
bbox_artist
5050
draw_bbox
51-

doc/api/toolkits/mplot3d/faq.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ Work is being done to eliminate this issue. For matplotlib v1.1.0, there is
4949
a semi-official manner to modify these parameters. See the note in the
5050
:mod:`.mplot3d.axis3d` section of the mplot3d API documentation for
5151
more information.
52-

doc/api/transformations.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@
1515
interval_contains, interval_contains_open
1616
:show-inheritance:
1717
:special-members:
18-

doc/api/tri_api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:show-inheritance:
1818

1919
.. autoclass:: matplotlib.tri.TriInterpolator
20-
20+
2121
.. autoclass:: matplotlib.tri.LinearTriInterpolator
2222
:members: __call__, gradient
2323
:show-inheritance:
@@ -30,7 +30,7 @@
3030

3131
.. autoclass:: matplotlib.tri.UniformTriRefiner
3232
:show-inheritance:
33-
:members:
33+
:members:
3434

3535
.. autoclass:: matplotlib.tri.TriAnalyzer
36-
:members:
36+
:members:

doc/devel/contributing.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ difficulty. ``Difficulty: Easy`` is suited for people with little Python experie
4040
``Difficulty: Medium`` and ``Difficulty: Hard`` are not trivial to solve and
4141
require more thought and programming experience.
4242

43-
In general, the Matplotlib project does not assign issues. Issues are
44-
"assigned" or "claimed" by opening a PR; there is no other assignment
45-
mechanism. If you have opened such a PR, please comment on the issue thread to
46-
avoid duplication of work. Please check if there is an existing PR for the
47-
issue you are addressing. If there is, try to work with the author by
48-
submitting reviews of their code or commenting on the PR rather than opening
49-
a new PR; duplicate PRs are subject to being closed. However, if the existing
50-
PR is an outline, unlikely to work, or stalled, and the original author is
51-
unresponsive, feel free to open a new PR referencing the old one.
43+
In general, the Matplotlib project does not assign issues. Issues are
44+
"assigned" or "claimed" by opening a PR; there is no other assignment
45+
mechanism. If you have opened such a PR, please comment on the issue thread to
46+
avoid duplication of work. Please check if there is an existing PR for the
47+
issue you are addressing. If there is, try to work with the author by
48+
submitting reviews of their code or commenting on the PR rather than opening
49+
a new PR; duplicate PRs are subject to being closed. However, if the existing
50+
PR is an outline, unlikely to work, or stalled, and the original author is
51+
unresponsive, feel free to open a new PR referencing the old one.
5252

5353
.. _submitting-a-bug-report:
5454

doc/devel/development_setup.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,18 @@ These will automatically check flake8 and other style issues when you run
6767
``git commit``. The hooks are defined in the top level
6868
``.pre-commit-config.yaml`` file. To install the hooks ::
6969

70-
pip install pre-commit
70+
python -m pip install pre-commit
7171
pre-commit install
7272

73+
The hooks can also be run manually. All the hooks can be run, in order as
74+
listed in ``.pre-commit-config.yaml``, against the full codebase with ::
75+
76+
pre-commit run --all-files
77+
78+
To run a particular hook manually, run ``pre-commit run`` with the hook id ::
79+
80+
pre-commit run <hook id> --all-files
81+
7382
Installing additional dependencies for development
7483
==================================================
7584
See :ref:`development-dependencies`.

doc/devel/style_guide.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,3 @@ resources contain common best practices for writing documentation.
406406
* `Google Developer Style Guide <https://developers.google.com/style>`_
407407
* `IBM Style Guide <https://www.oreilly.com/library/view/the-ibm-style/9780132118989/>`_
408408
* `Red Hat Style Guide <https://stylepedia.net/style/#grammar>`_
409-

doc/devel/testing.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,3 @@ The test discovery scope can be narrowed to single test modules or even single
256256
functions::
257257

258258
python -m pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping
259-

doc/missing-references.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,4 +1107,4 @@
11071107
"lib/mpl_toolkits/mplot3d/axes3d.py:docstring of mpl_toolkits.mplot3d.axes3d.Axes3D.get_ylim3d:24"
11081108
]
11091109
}
1110-
}
1110+
}

doc/users/explain/fonts.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. redirect-from:: /users/fonts
2-
2+
33
Fonts in Matplotlib text engine
44
===============================
55

doc/users/faq/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. redirect-from:: /faq/index
44

55
##########################
6-
How-to and troubleshooting
6+
How-to and troubleshooting
77
##########################
88

99
.. only:: html

doc/users/github_stats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Pull Requests (84):
4545
* :ghpull:`21908`: Backport PR #21834 on branch v3.5.x (MAINT Fix signature qhull version function )
4646
* :ghpull:`21907`: Backport PR #21905 on branch v3.5.x (Fix image testing decorator in pytest importlib mode)
4747
* :ghpull:`21906`: Backport PR #21773 on branch v3.5.x (FIX: Reset label of axis to center)
48-
* :ghpull:`21834`: MAINT Fix signature qhull version function
48+
* :ghpull:`21834`: MAINT Fix signature qhull version function
4949
* :ghpull:`21905`: Fix image testing decorator in pytest importlib mode
5050
* :ghpull:`21773`: FIX: Reset label of axis to center
5151
* :ghpull:`21902`: Backport PR #21884 on branch v3.5.x (FIX: be more careful about coercing unit-full containers to ndarray)

doc/users/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Tutorials and examples
2929
../tutorials/index.rst
3030
../gallery/index.rst
3131

32-
Reference
32+
Reference
3333
#########
3434

3535
.. toctree::

doc/users/next_whats_new/3d_plot_roll_angle.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ existing 3D plots.
1010

1111
.. plot::
1212
:include-source: true
13-
13+
1414
from mpl_toolkits.mplot3d import axes3d
1515
import matplotlib.pyplot as plt
1616
fig = plt.figure()

0 commit comments

Comments
 (0)
0