Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
134 lines (134 loc) · 5.18 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
134 lines (134 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
ci:
autofix_prs: false
autoupdate_schedule: 'quarterly'
exclude: |
(?x)^(
extern|
subprojects/packagefiles|
LICENSE|
lib/matplotlib/mpl-data|
doc/devel/gitwash|
doc/release/prev|
doc/api/prev|
lib/matplotlib/tests/data/tinypages
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
exclude: lib/matplotlib/typing.py # docstring used for attribute flagged by check
- id: end-of-file-fixer
exclude_types: [diff, svg]
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: no-commit-to-branch # Default is master and main.
- id: trailing-whitespace
exclude_types: [diff, svg]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 2834ec6639549dd6796205c8f011dedcd587288b # frozen: v2.4.0
hooks:
- id: mypy
additional_dependencies:
- pandas-stubs
- types-pillow
- types-python-dateutil
- types-psutil
- types-docutils
- types-PyYAML
args: ["--config-file=pyproject.toml", "lib/matplotlib"]
files: lib/matplotlib # Only run when files in lib/matplotlib are changed.
pass_filenames: false
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: f368fb366ff7f2f808dd324b83a6d32267799e19 # frozen: v0.17.2
hooks:
# Run the linter.
- id: ruff-check
args: [--fix, --show-fixes]
# Sort imports in the galleries, mirroring the previous isort scope.
- id: ruff-check
name: ruff isort (galleries)
args: [--fix, --show-fixes, --select=I001]
files: ^galleries/tutorials/|^galleries/examples/|^galleries/plot_types/
- repo: https://github.com/codespell-project/codespell
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
hooks:
- id: codespell
files: ^.*\.(py|c|cpp|h|m|md|rst|yml)$
args:
- "--ignore-words"
- "ci/codespell-ignore-words.txt"
- "--skip"
- "doc/project/credits.rst"
- repo: https://github.com/rstcheck/rstcheck
rev: d8774e96810795967ed9603f445b4e751e7b313f # frozen: v6.3.0
hooks:
- id: rstcheck
additional_dependencies:
- sphinx>=9.2.0
args: ["--sphinx-source-dir", "doc"]
- repo: https://github.com/adrienverge/yamllint
rev: cba56bcde1fdd01c1deb3f945e69764c291a6530 # frozen: v1.38.0
hooks:
- id: yamllint
args: ["--strict", "--config-file=.yamllint.yml"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1
hooks:
- id: shellcheck
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1
hooks:
- id: zizmor
- repo: https://github.com/simple-icons/svglint
rev: 8402586b94f073686e46707a163082e270ee5768 # frozen: v4.2.1
hooks:
- id: svglint
# Override the top-level exclude so that mpl-data/images/ toolbar
# icons are also linted. Exemptions for the intentional interactive
# SVG examples are handled in .svglintrc.mjs.
exclude: '^$'
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0494aa7fa1314e98913a41227d8f0a515b2c1049 # frozen: 0.38.2
hooks:
- id: check-dependabot
- id: check-github-workflows
# NOTE: If any of the below schema files need to be changed, be sure to
# update the `ci/vendor_schemas.py` script.
- id: check-jsonschema
name: "Validate CircleCI config"
files: ^\.circleci/config\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/circleciconfig.json"]
- id: check-jsonschema
name: "Validate GitHub funding file"
files: ^\.github/FUNDING\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/github-funding.json"]
- id: check-jsonschema
name: "Validate GitHub issue config"
files: ^\.github/ISSUE_TEMPLATE/config\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/github-issue-config.json"]
- id: check-jsonschema
name: "Validate GitHub issue templates"
files: ^\.github/ISSUE_TEMPLATE/.*\.yml$
exclude: ^\.github/ISSUE_TEMPLATE/config\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/github-issue-forms.json"]
- id: check-jsonschema
name: "Validate CodeCov config"
files: ^\.github/codecov\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/codecov.json"]
- id: check-jsonschema
name: "Validate GitHub labeler config"
files: ^\.github/labeler\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/pull-request-labeler-5.json"]
- id: check-jsonschema
name: "Validate Conda environment file"
files: ^environment\.yml$
args: ["--verbose", "--schemafile", "ci/schemas/conda-environment.json"]
- repo: https://github.com/oxipng/oxipng
rev: 36f3ef8aac65ecf1761739ea2f2e530281f1312b # frozen: v10.2.1
hooks:
- id: oxipng