-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
148 lines (125 loc) · 3.96 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
148 lines (125 loc) · 3.96 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
minimum_pre_commit_version: '2.8.2'
default_language_version:
python: python3
default_stages: [pre-commit]
repos:
# General file checks and fixers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
name: "Ensure files end with a single newline"
- id: mixed-line-ending
name: "Normalize mixed line endings"
args: [--fix=lf]
- id: trailing-whitespace
name: "Remove trailing whitespace"
- id: file-contents-sorter
name: "Sort codespell ignore list"
files: '.codespell/ignore-words.txt'
- id: check-case-conflict
name: "Check for case conflicts"
- id: check-merge-conflict
name: "Check for merge conflict markers"
- id: check-executables-have-shebangs
name: "Check that executables have shebangs"
- id: check-shebang-scripts-are-executable
name: "Check that shebangs are executable"
- id: check-vcs-permalinks
name: "Check that VCS links are permalinks"
# - id: check-ast
# name: "Check Python AST"
- id: check-json
name: "Check JSON"
- id: check-toml
name: "Check TOML"
- id: check-yaml
name: "Check YAML"
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
hooks:
- id: black
name: "Format with Black"
args:
- '--target-version=py39'
- '--target-version=py310'
files: '^(peps/conf\.py|pep_sphinx_extensions/tests/.*)$'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.21
hooks:
- id: ruff-check
name: "Lint with Ruff"
args:
- '--exit-non-zero-on-fix'
files: '^pep_sphinx_extensions/tests/'
- id: ruff-format
name: "Format with Ruff"
args:
- '--check'
files: '^release_management/'
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.4
hooks:
- id: check-dependabot
- id: check-github-workflows
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.26.1
hooks:
- id: zizmor
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.7.2
hooks:
- id: tox-ini-fmt
name: "Format tox.ini"
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.2
hooks:
- id: sphinx-lint
name: "Sphinx lint"
args: ["--disable=trailing-whitespace"]
# RST checks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
name: "Check RST: No single backticks"
- id: rst-inline-touching-normal
name: "Check RST: No backticks touching text"
- id: rst-directive-colons
name: "Check RST: 2 colons after directives"
# Manual codespell check
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
name: "Check for common misspellings in text files"
require_serial: true
stages: [manual]
# Local checks for PEP headers and more
- repo: local
hooks:
# Hook to run "check-peps.py"
- id: "check-peps"
name: "Check PEPs for metadata and content enforcement"
entry: "python check-peps.py"
language: "python"
files: '^peps/pep-\d{4}\.rst$'
require_serial: true
# Hook to regenerate release schedules
- id: "regen-schedules"
name: "Regenerate release schedules from python-releases.toml"
entry: "python -m release_management update-peps"
language: "python"
files: "^release_management/"
pass_filenames: false
require_serial: true
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes