@@ -14,13 +14,21 @@ exclude_patterns = [
14
14
]
15
15
command = [
16
16
' python3' ,
17
- ' tools/linter/adapters/flake8_linter.py' ,
17
+ ' tools/linter/adapters/run_from_link_linter.py' ,
18
+ ' --run-lint' ,
19
+ ' --lint-name=flake8_linter.py' ,
18
20
' --' ,
19
21
' @{{PATHSFILE}}'
20
22
]
21
23
init_command = [
22
24
' python3' ,
23
- ' tools/linter/adapters/pip_init.py' ,
25
+ ' tools/linter/adapters/run_from_link_linter.py' ,
26
+ ' --run-init' ,
27
+ ' --init-name=pip_init.py' ,
28
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/pip_init.py' ,
29
+ ' --lint-name=flake8_linter.py' ,
30
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/flake8_linter.py' ,
31
+ ' --' ,
24
32
' --dry-run={{DRYRUN}}' ,
25
33
' flake8==6.1.0' ,
26
34
' flake8-bugbear==23.3.23' ,
@@ -55,14 +63,23 @@ exclude_patterns = [
55
63
]
56
64
command = [
57
65
' python3' ,
58
- ' tools/linter/adapters/mypy_linter.py' ,
66
+ ' tools/linter/adapters/run_from_link_linter.py' ,
67
+ ' --run-lint' ,
68
+ ' --lint-name=mypy_linter.py' ,
69
+ ' --' ,
59
70
' --config=mypy.ini' ,
60
71
' --' ,
61
72
' @{{PATHSFILE}}'
62
73
]
63
74
init_command = [
64
75
' python3' ,
65
- ' tools/linter/adapters/pip_init.py' ,
76
+ ' tools/linter/adapters/run_from_link_linter.py' ,
77
+ ' --run-init' ,
78
+ ' --init-name=pip_init.py' ,
79
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/pip_init.py' ,
80
+ ' --lint-name=mypy_linter.py' ,
81
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/mypy_linter.py' ,
82
+ ' --' ,
66
83
' --dry-run={{DRYRUN}}' ,
67
84
" boto3==1.38.29" ,
68
85
" botocore==1.38.29" ,
@@ -93,9 +110,20 @@ exclude_patterns = [
93
110
" tools/stronghold/src/api/types.py" ,
94
111
" tools/stronghold/tests/api/test_ast_param_types.py" ,
95
112
]
113
+ init_command = [
114
+ ' python3' ,
115
+ ' tools/linter/adapters/run_from_link_linter.py' ,
116
+ ' --lint-name=grep_linter.py' ,
117
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/grep_linter.py' ,
118
+ ' --' ,
119
+ ' --dry-run={{DRYRUN}}' ,
120
+ ]
96
121
command = [
97
122
' python3' ,
98
- ' tools/linter/adapters/grep_linter.py' ,
123
+ ' tools/linter/adapters/run_from_link_linter.py' ,
124
+ ' --run-lint' ,
125
+ ' --lint-name=grep_linter.py' ,
126
+ ' --' ,
99
127
' --pattern=# type:\s*ignore([^\[]|$)' ,
100
128
' --linter-name=TYPEIGNORE' ,
101
129
' --error-name=unqualified type: ignore' ,
@@ -110,9 +138,20 @@ command = [
110
138
[[linter ]]
111
139
code = ' NOQA'
112
140
include_patterns = [' **/*.py' , ' **/*.pyi' ]
141
+ init_command = [
142
+ ' python3' ,
143
+ ' tools/linter/adapters/run_from_link_linter.py' ,
144
+ ' --lint-name=grep_linter.py' ,
145
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/grep_linter.py' ,
146
+ ' --' ,
147
+ ' --dry-run={{DRYRUN}}' ,
148
+ ]
113
149
command = [
114
150
' python3' ,
115
- ' tools/linter/adapters/grep_linter.py' ,
151
+ ' tools/linter/adapters/run_from_link_linter.py' ,
152
+ ' --run-lint' ,
153
+ ' --lint-name=grep_linter.py' ,
154
+ ' --' ,
116
155
' --pattern=# noqa([^:]|$)' ,
117
156
' --linter-name=NOQA' ,
118
157
' --error-name=unqualified noqa' ,
@@ -139,9 +178,19 @@ exclude_patterns=[
139
178
' .github/actions/upload-artifact-s3/dist/upload/index.js' ,
140
179
' tools/clang-tidy-checks/*-patches/**' ,
141
180
]
181
+ init_command = [
182
+ ' python3' ,
183
+ ' tools/linter/adapters/run_from_link_linter.py' ,
184
+ ' --lint-name=newlines_linter.py' ,
185
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/newlines_linter.py' ,
186
+ ' --' ,
187
+ ' --dry-run={{DRYRUN}}' ,
188
+ ]
142
189
command = [
143
190
' python3' ,
144
- ' tools/linter/adapters/newlines_linter.py' ,
191
+ ' tools/linter/adapters/run_from_link_linter.py' ,
192
+ ' --run-lint' ,
193
+ ' --lint-name=newlines_linter.py' ,
145
194
' --' ,
146
195
' @{{PATHSFILE}}' ,
147
196
]
@@ -159,9 +208,20 @@ exclude_patterns = [
159
208
' .github/actions/setup-ssh/index.js' ,
160
209
' .github/actions/upload-artifact-s3/dist/upload/index.js' ,
161
210
]
211
+ init_command = [
212
+ ' python3' ,
213
+ ' tools/linter/adapters/run_from_link_linter.py' ,
214
+ ' --lint-name=newlines_linter.py' ,
215
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/newlines_linter.py' ,
216
+ ' --' ,
217
+ ' --dry-run={{DRYRUN}}' ,
218
+ ]
162
219
command = [
163
220
' python3' ,
164
- ' tools/linter/adapters/grep_linter.py' ,
221
+ ' tools/linter/adapters/run_from_link_linter.py' ,
222
+ ' --run-lint' ,
223
+ ' --lint-name=grep_linter.py' ,
224
+ ' --' ,
165
225
' --pattern=[[:blank:]]$' ,
166
226
' --linter-name=SPACES' ,
167
227
' --error-name=trailing spaces' ,
@@ -189,9 +249,20 @@ exclude_patterns = [
189
249
' terraform-aws-github-runner/**' ,
190
250
' aws/ami/windows/**' ,
191
251
]
252
+ init_command = [
253
+ ' python3' ,
254
+ ' tools/linter/adapters/run_from_link_linter.py' ,
255
+ ' --lint-name=newlines_linter.py' ,
256
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/newlines_linter.py' ,
257
+ ' --' ,
258
+ ' --dry-run={{DRYRUN}}' ,
259
+ ]
192
260
command = [
193
261
' python3' ,
194
- ' tools/linter/adapters/grep_linter.py' ,
262
+ ' tools/linter/adapters/run_from_link_linter.py' ,
263
+ ' --run-lint' ,
264
+ ' --lint-name=grep_linter.py' ,
265
+ ' --' ,
195
266
# @lint-ignore TXT2
196
267
' --pattern= ' ,
197
268
' --linter-name=TABS' ,
@@ -222,9 +293,20 @@ exclude_patterns = [
222
293
" .github/workflows/validate-linux-binaries.yml" ,
223
294
" .github/workflows/validate-repackaged-binary-sizes.yml" ,
224
295
]
296
+ init_command = [
297
+ ' python3' ,
298
+ ' tools/linter/adapters/run_from_link_linter.py' ,
299
+ ' --lint-name=grep_linter.py' ,
300
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/grep_linter.py' ,
301
+ ' --' ,
302
+ ' --dry-run={{DRYRUN}}' ,
303
+ ]
225
304
command = [
226
305
' python3' ,
227
- ' tools/linter/adapters/grep_linter.py' ,
306
+ ' tools/linter/adapters/run_from_link_linter.py' ,
307
+ ' --run-lint' ,
308
+ ' --lint-name=grep_linter.py' ,
309
+ ' --' ,
228
310
""" --pattern=\
229
311
(pip|pip3|python -m pip|python3 -m pip|python3 -mpip|python -mpip) \
230
312
install ([a-zA-Z0-9][A-Za-z0-9\\ ._\\ -]+)([^/=<>~!]+)[A-Za-z0-9\\ ._\\ -\\ *\\ +\\ !]*$\
@@ -257,9 +339,19 @@ exclude_patterns = [
257
339
# Putting this exclusion just to get the linter running.
258
340
" tools/stronghold/bin/build-check-api-compatibility" ,
259
341
]
342
+ init_command = [
343
+ ' python3' ,
344
+ ' tools/linter/adapters/run_from_link_linter.py' ,
345
+ ' --lint-name=exec_linter.py' ,
346
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/exec_linter.py' ,
347
+ ' --' ,
348
+ ' --dry-run={{DRYRUN}}' ,
349
+ ]
260
350
command = [
261
351
' python3' ,
262
- ' tools/linter/adapters/exec_linter.py' ,
352
+ ' tools/linter/adapters/run_from_link_linter.py' ,
353
+ ' --run-lint' ,
354
+ ' --lint-name=exec_linter.py' ,
263
355
' --' ,
264
356
' @{{PATHSFILE}}' ,
265
357
]
@@ -275,14 +367,23 @@ include_patterns = [
275
367
]
276
368
command = [
277
369
' python3' ,
278
- ' tools/linter/adapters/actionlint_linter.py' ,
370
+ ' tools/linter/adapters/run_from_link_linter.py' ,
371
+ ' --run-lint' ,
372
+ ' --lint-name=actionlint_linter.py' ,
373
+ ' --' ,
279
374
' --binary=.lintbin/actionlint' ,
280
375
' --' ,
281
376
' @{{PATHSFILE}}' ,
282
377
]
283
378
init_command = [
284
379
' python3' ,
285
- ' tools/linter/adapters/s3_init.py' ,
380
+ ' tools/linter/adapters/run_from_link_linter.py' ,
381
+ ' --run-init' ,
382
+ ' --init-name=s3_init.py' ,
383
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8b840be3d03cf2f7dc4a373f9b0a95f1411cb89/tools/linter/adapters/s3_init.py' ,
384
+ ' --lint-name=actionlint_linter.py' ,
385
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/actionlint_linter.py' ,
386
+ ' --' ,
286
387
' --config-json=tools/linter/adapters/s3_init_config.json' ,
287
388
' --linter=actionlint' ,
288
389
' --dry-run={{DRYRUN}}' ,
@@ -299,6 +400,7 @@ include_patterns = [
299
400
command = [
300
401
' python3' ,
301
402
' tools/linter/adapters/run_from_link_linter.py' ,
403
+ ' --run-lint' ,
302
404
' --lint-name=pyfmt_linter.py' ,
303
405
' --' ,
304
406
' @{{PATHSFILE}}'
@@ -308,9 +410,9 @@ init_command = [
308
410
' tools/linter/adapters/run_from_link_linter.py' ,
309
411
' --run-init' ,
310
412
' --init-name=pip_init.py' ,
311
- ' --init-link=https://raw.githubusercontent.com/pytorch/test-infra/main /tools/linter/adapters/pip_init.py' ,
413
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5 /tools/linter/adapters/pip_init.py' ,
312
414
' --lint-name=pyfmt_linter.py' ,
313
- ' --lint-link=https://raw.githubusercontent.com/pytorch/test-infra/main /tools/linter/adapters/pyfmt_linter.py' ,
415
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a /tools/linter/adapters/pyfmt_linter.py' ,
314
416
' --' ,
315
417
' --dry-run={{DRYRUN}}' ,
316
418
' --no-black-binary' ,
@@ -325,9 +427,20 @@ is_formatter = true
325
427
code = ' COPYRIGHT'
326
428
include_patterns = [' **' ]
327
429
exclude_patterns = [' .lintrunner.toml' , ' **/fixtures/**' ]
430
+ init_command = [
431
+ ' python3' ,
432
+ ' tools/linter/adapters/run_from_link_linter.py' ,
433
+ ' --lint-name=grep_linter.py' ,
434
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/grep_linter.py' ,
435
+ ' --' ,
436
+ ' --dry-run={{DRYRUN}}' ,
437
+ ]
328
438
command = [
329
439
' python3' ,
330
- ' tools/linter/adapters/grep_linter.py' ,
440
+ ' tools/linter/adapters/run_from_link_linter.py' ,
441
+ ' --run-lint' ,
442
+ ' --lint-name=grep_linter.py' ,
443
+ ' --' ,
331
444
' --pattern=Confidential and proprietary' ,
332
445
' --linter-name=COPYRIGHT' ,
333
446
' --error-name=Confidential Code' ,
@@ -342,9 +455,19 @@ command = [
342
455
[[linter ]]
343
456
code = ' LINTRUNNER_VERSION'
344
457
include_patterns = [' **' ]
458
+ init_command = [
459
+ ' python3' ,
460
+ ' tools/linter/adapters/run_from_link_linter.py' ,
461
+ ' --lint-name=lintrunner_version_linter.py' ,
462
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/267f82b860ccdf32df3dcb92e2435b64ba0f117a/tools/linter/adapters/lintrunner_version_linter.py' ,
463
+ ' --' ,
464
+ ' --dry-run={{DRYRUN}}' ,
465
+ ]
345
466
command = [
346
467
' python3' ,
347
- ' tools/linter/adapters/lintrunner_version_linter.py'
468
+ ' tools/linter/adapters/run_from_link_linter.py' ,
469
+ ' --run-lint' ,
470
+ ' --lint-name=lintrunner_version_linter.py' ,
348
471
]
349
472
350
473
[[linter ]]
@@ -360,15 +483,24 @@ exclude_patterns = [
360
483
]
361
484
command = [
362
485
' python3' ,
363
- ' tools/linter/adapters/ruff_linter.py' ,
486
+ ' tools/linter/adapters/run_from_link_linter.py' ,
487
+ ' --run-lint' ,
488
+ ' --lint-name=ruff_linter.py' ,
489
+ ' --' ,
364
490
' --config=pyproject.toml' ,
365
491
' --show-disable' ,
366
492
' --' ,
367
493
' @{{PATHSFILE}}'
368
494
]
369
495
init_command = [
370
496
' python3' ,
371
- ' tools/linter/adapters/pip_init.py' ,
497
+ ' tools/linter/adapters/run_from_link_linter.py' ,
498
+ ' --run-init' ,
499
+ ' --init-name=pip_init.py' ,
500
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/pip_init.py' ,
501
+ ' --lint-name=ruff_linter.py' ,
502
+ ' --lint-link=https://raw.githubusercontent.com/pytorch/pytorch/d0b98746039990d9f82f2c72d7256f89ac69875a/tools/linter/adapters/ruff_linter.py' ,
503
+ ' --' ,
372
504
' --dry-run={{DRYRUN}}' ,
373
505
' ruff==0.8.4' , # sync with PYFMT
374
506
]
@@ -384,7 +516,11 @@ command = [
384
516
]
385
517
init_command = [
386
518
' python3' ,
387
- ' tools/linter/adapters/pip_init.py' ,
519
+ ' tools/linter/adapters/run_from_link_linter.py' ,
520
+ ' --run-init' ,
521
+ ' --init-name=pip_init.py' ,
522
+ ' --init-link=https://raw.githubusercontent.com/pytorch/pytorch/b8895df8db23213a0db50fe833930dd1f4e4b5a5/tools/linter/adapters/pip_init.py' ,
523
+ ' --' ,
388
524
' --dry-run={{DRYRUN}}' ,
389
525
' sqlfluff==3.3.0' ,
390
526
]
0 commit comments