@@ -82,16 +82,12 @@ repos:
82
82
hooks :
83
83
- id : rst-backticks
84
84
name : " Check RST: No single backticks"
85
- files : ' ^pep-\d+\.(rst|txt)$'
86
- types : [text]
85
+
87
86
- id : rst-inline-touching-normal
88
87
name : " Check RST: No backticks touching text"
89
- files : ' ^pep-\d+\.(rst|txt)$'
90
- types : [text]
88
+
91
89
- id : rst-directive-colons
92
90
name : " Check RST: 2 colons after directives"
93
- files : ' ^pep-\d+\.(rst|txt)$'
94
- types : [text]
95
91
96
92
# Manual codespell check
97
93
- repo : https://github.com/codespell-project/codespell
@@ -112,152 +108,126 @@ repos:
112
108
# files: "^pep-\d{4}\.(rst|txt)$"
113
109
# require_serial: true
114
110
115
- - id : check-no-tabs
116
- name : " Check tabs not used in PEPs"
117
- language : pygrep
118
- entry : ' \t'
119
- files : ' ^pep-\d+\.(rst|txt)$'
120
- types : [text]
121
-
122
111
- id : check-required-headers
123
112
name : " PEPs must have all required headers"
124
113
language : pygrep
125
114
entry : ' (?-m:^PEP:(?=[\s\S]*\nTitle:)(?=[\s\S]*\nAuthor:)(?=[\s\S]*\nStatus:)(?=[\s\S]*\nType:)(?=[\s\S]*\nContent-Type:)(?=[\s\S]*\nCreated:))'
126
115
args : ['--negate', '--multiline']
127
- files : ' ^pep-\d+\.(rst|txt)$'
128
- types : [text]
116
+ files : ' ^peps/pep-\d+\.rst$'
129
117
130
118
- id : check-header-order
131
119
name : " PEP header order must follow PEP 12"
132
120
language : pygrep
133
121
entry : ' ^PEP:[^\n]+\nTitle:[^\n]+\n(Version:[^\n]+\n)?(Last-Modified:[^\n]+\n)?Author:[^\n]+\n( +\S[^\n]+\n)*(Sponsor:[^\n]+\n)?((PEP|BDFL)-Delegate:[^\n]*\n)?(Discussions-To:[^\n]*\n)?Status:[^\n]+\nType:[^\n]+\n(Topic:[^\n]+\n)?Content-Type:[^\n]+\n(Requires:[^\n]+\n)?Created:[^\n]+\n(Python-Version:[^\n]*\n)?(Post-History:[^\n]*\n( +\S[^\n]*\n)*)?(Replaces:[^\n]+\n)?(Superseded-By:[^\n]+\n)?(Resolution:[^\n]*\n)?\n'
134
122
args : ['--negate', '--multiline']
135
- files : ' ^pep-\d+\.(rst|txt)$'
136
- types : [text]
123
+ files : ' ^peps/pep-\d+\.rst$'
137
124
138
125
- id : validate-pep-number
139
126
name : " 'PEP' header must be a number 1-9999"
140
127
language : pygrep
141
128
entry : ' (?-m:^PEP:(?:(?! +(0|[1-9][0-9]{0,3})\n)))'
142
129
args : ['--multiline']
143
- files : ' ^pep-\d+\.(rst|txt)$'
144
- types : [text]
130
+ files : ' ^peps/pep-\d+\.rst$'
145
131
146
132
- id : validate-title
147
133
name : " 'Title' must be 1-79 characters"
148
134
language : pygrep
149
135
entry : ' (?<=\n)Title:(?:(?! +\S.{1,78}\n(?=[A-Z])))'
150
136
args : ['--multiline']
151
- files : ' ^pep-\d+\.(rst|txt)$'
152
- exclude : ' ^pep-(0499)\.(rst|txt)$'
153
- types : [text]
137
+ files : ' ^peps/pep-\d+\.rst$'
138
+ exclude : ' ^peps/pep-(0499)\.rst$'
154
139
155
140
- id : validate-author
156
141
name :
" 'Author' must be list of 'Name <[email protected] >, ...'"
157
142
language : pygrep
158
143
entry : ' (?<=\n)Author:(?:(?!((( +|\n {1,8})[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&'' *+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?)(,|(?=\n[^ ])))+\n(?=[A-Z])))'
159
- args : [--multiline]
160
- files : ' ^pep-\d+\.(rst|txt)$'
161
- types : [text]
144
+ args : ["--multiline"]
145
+ files : ' ^peps/pep-\d+\.rst$'
162
146
163
147
- id : validate-sponsor
164
148
name :
" 'Sponsor' must have format 'Name <[email protected] >'"
165
149
language : pygrep
166
150
entry : ' ^Sponsor:(?: (?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&'' *+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))'
167
- files : ' ^pep-\d+\.(rst|txt)$'
168
- types : [text]
151
+ files : ' ^peps/pep-\d+\.rst$'
169
152
170
153
- id : validate-delegate
171
154
name :
" 'Delegate' must have format 'Name <[email protected] >'"
172
155
language : pygrep
173
156
entry : ' ^(PEP|BDFL)-Delegate: (?:(?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&'' *+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))'
174
- files : ' ^pep-\d+\.(rst|txt)$'
175
- exclude : ' ^pep-(0451)\.(rst|txt)$'
176
- types : [text]
157
+ files : ' ^peps/pep-\d+\.rst$'
158
+ exclude : ' ^peps/pep-(0451)\.rst$'
177
159
178
160
- id : validate-discussions-to
179
161
name : " 'Discussions-To' must be a thread URL"
180
162
language : pygrep
181
163
entry : ' ^Discussions-To: (?:(?!([\w\-]+@(python\.org|googlegroups\.com))|https://((discuss\.python\.org/t/([\w\-]+/)?\d+/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?))$))'
182
- files : ' ^pep-\d+\.(rst|txt)$'
183
- types : [text]
164
+ files : ' ^peps/pep-\d+\.rst$'
184
165
185
166
- id : validate-status
186
167
name : " 'Status' must be a valid PEP status"
187
168
language : pygrep
188
169
entry : ' ^Status:(?:(?! +(Draft|Withdrawn|Rejected|Accepted|Final|Active|Provisional|Deferred|Superseded|April Fool!)$))'
189
- files : ' ^pep-\d+\.(rst|txt)$'
190
- types : [text]
170
+ files : ' ^peps/pep-\d+\.rst$'
191
171
192
172
- id : validate-type
193
173
name : " 'Type' must be a valid PEP type"
194
174
language : pygrep
195
175
entry : ' ^Type:(?:(?! +(Standards Track|Informational|Process)$))'
196
- files : ' ^pep-\d+\.(rst|txt)$'
197
- types : [text]
176
+ files : ' ^peps/pep-\d+\.rst$'
198
177
199
178
- id : validate-topic
200
179
name : " 'Topic' must be for a valid sub-index"
201
180
language : pygrep
202
181
entry : ' ^Topic:(?:(?! +(Governance|Packaging|Typing|Release)(, (Governance|Packaging|Typing|Release))*$))'
203
- files : ' ^pep-\d+\.(rst|txt)$'
204
- types : [text]
182
+ files : ' ^peps/pep-\d+\.rst$'
205
183
206
184
- id : validate-content-type
207
185
name : " 'Content-Type' must be 'text/x-rst'"
208
186
language : pygrep
209
187
entry : ' ^Content-Type:(?:(?! +text/x-rst$))'
210
- files : ' ^pep-\d+\.(rst|txt)$'
211
- types : [text]
188
+ files : ' ^peps/pep-\d+\.rst$'
212
189
213
190
- id : validate-pep-references
214
191
name : " `Requires`/`Replaces`/`Superseded-By` must be 'NNN' PEP IDs"
215
192
language : pygrep
216
193
entry : ' ^(Requires|Replaces|Superseded-By):(?:(?! *( (0|[1-9][0-9]{0,3})(,|$))+$))'
217
- files : ' ^pep-\d+\.(rst|txt)$'
218
- types : [text]
194
+ files : ' ^peps/pep-\d+\.rst$'
219
195
220
196
- id : validate-created
221
197
name : " 'Created' must be a 'DD-mmm-YYYY' date"
222
198
language : pygrep
223
199
entry : ' ^Created:(?:(?! +([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])$))'
224
- files : ' ^pep-\d+\.(rst|txt)$'
225
- types : [text]
200
+ files : ' ^peps/pep-\d+\.rst$'
226
201
227
202
- id : validate-python-version
228
203
name : " 'Python-Version' must be a 'X.Y[.Z]` version"
229
204
language : pygrep
230
205
entry : ' ^Python-Version:(?:(?! *( [1-9]\.([0-9][0-9]?|x)(\.[1-9][0-9]?)?(,|$))+$))'
231
- files : ' ^pep-\d+\.(rst|txt)$'
232
- types : [text]
206
+ files : ' ^peps/pep-\d+\.rst$'
233
207
234
208
- id : validate-post-history
235
209
name : " 'Post-History' must be '`DD-mmm-YYYY <Thread URL>`__, ...'"
236
210
language : pygrep
237
211
entry : ' (?<=\n)Post-History:(?:(?! ?\n|((( +|\n {1,14})(([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])|`([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9]) <https://((discuss\.python\.org/t/([\w\-]+/)?\d+(?:/\d+/|/?))|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))>`__)(,|(?=\n[^ ])))+\n(?=[A-Z\n]))))'
238
212
args : [--multiline]
239
- files : ' ^pep-\d+\.(rst|txt)$'
240
- types : [text]
213
+ files : ' ^peps/pep-\d+\.rst$'
241
214
242
215
- id : validate-resolution
243
216
name : " 'Resolution' must be a direct thread/message URL"
244
217
language : pygrep
245
218
entry : ' (?<!\n\n)(?<=\n)Resolution: (?:(?!https://((discuss\.python\.org/t/([\w\-]+/)?\d+(/\d+)?/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/(message|thread)/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))\n))'
246
219
args : ['--multiline']
247
- files : ' ^pep-\d+\.(rst|txt)$'
248
- types : [text]
220
+ files : ' ^peps/pep-\d+\.rst$'
249
221
250
222
- id : check-direct-pep-links
251
223
name : " Check that PEPs aren't linked directly"
252
224
language : pygrep
253
225
entry : ' (dev/peps|peps\.python\.org)/pep-\d+'
254
- files : ' ^pep-\d+\.(rst|txt)$'
255
- exclude : ' ^pep-(0009|0287|0676|0684|8001)\.(rst|txt)$'
256
- types : [text]
226
+ files : ' ^peps/pep-\d+\.rst$'
227
+ exclude : ' ^peps/pep-(0009|0287|0676|0684|8001)\.rst$'
257
228
258
229
- id : check-direct-rfc-links
259
230
name : " Check that RFCs aren't linked directly"
260
231
language : pygrep
261
232
entry : ' (rfc-editor\.org|ietf\.org)/[\.\-_\?\&\#\w/]*[Rr][Ff][Cc][\-_]?\d+'
262
- files : ' \.(rst|txt)$'
263
- types : [text]
233
+ types : ['rst']
0 commit comments