@@ -14,13 +14,21 @@ exclude_patterns = [
1414]
1515command = [
1616 ' 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' ,
1820 ' --' ,
1921 ' @{{PATHSFILE}}'
2022]
2123init_command = [
2224 ' 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+ ' --' ,
2432 ' --dry-run={{DRYRUN}}' ,
2533 ' flake8==6.1.0' ,
2634 ' flake8-bugbear==23.3.23' ,
@@ -55,14 +63,23 @@ exclude_patterns = [
5563]
5664command = [
5765 ' 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+ ' --' ,
5970 ' --config=mypy.ini' ,
6071 ' --' ,
6172 ' @{{PATHSFILE}}'
6273]
6374init_command = [
6475 ' 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+ ' --' ,
6683 ' --dry-run={{DRYRUN}}' ,
6784 " boto3==1.38.29" ,
6885 " botocore==1.38.29" ,
@@ -93,9 +110,20 @@ exclude_patterns = [
93110 " tools/stronghold/src/api/types.py" ,
94111 " tools/stronghold/tests/api/test_ast_param_types.py" ,
95112]
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+ ]
96121command = [
97122 ' 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+ ' --' ,
99127 ' --pattern=# type:\s*ignore([^\[]|$)' ,
100128 ' --linter-name=TYPEIGNORE' ,
101129 ' --error-name=unqualified type: ignore' ,
@@ -110,9 +138,20 @@ command = [
110138[[linter ]]
111139code = ' NOQA'
112140include_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+ ]
113149command = [
114150 ' 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+ ' --' ,
116155 ' --pattern=# noqa([^:]|$)' ,
117156 ' --linter-name=NOQA' ,
118157 ' --error-name=unqualified noqa' ,
@@ -139,9 +178,19 @@ exclude_patterns=[
139178 ' .github/actions/upload-artifact-s3/dist/upload/index.js' ,
140179 ' tools/clang-tidy-checks/*-patches/**' ,
141180]
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+ ]
142189command = [
143190 ' 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' ,
145194 ' --' ,
146195 ' @{{PATHSFILE}}' ,
147196]
@@ -159,9 +208,20 @@ exclude_patterns = [
159208 ' .github/actions/setup-ssh/index.js' ,
160209 ' .github/actions/upload-artifact-s3/dist/upload/index.js' ,
161210]
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+ ]
162219command = [
163220 ' 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+ ' --' ,
165225 ' --pattern=[[:blank:]]$' ,
166226 ' --linter-name=SPACES' ,
167227 ' --error-name=trailing spaces' ,
@@ -189,9 +249,20 @@ exclude_patterns = [
189249 ' terraform-aws-github-runner/**' ,
190250 ' aws/ami/windows/**' ,
191251]
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+ ]
192260command = [
193261 ' 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+ ' --' ,
195266 # @lint-ignore TXT2
196267 ' --pattern= ' ,
197268 ' --linter-name=TABS' ,
@@ -222,9 +293,20 @@ exclude_patterns = [
222293 " .github/workflows/validate-linux-binaries.yml" ,
223294 " .github/workflows/validate-repackaged-binary-sizes.yml" ,
224295]
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+ ]
225304command = [
226305 ' 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+ ' --' ,
228310 """ --pattern=\
229311 (pip|pip3|python -m pip|python3 -m pip|python3 -mpip|python -mpip) \
230312 install ([a-zA-Z0-9][A-Za-z0-9\\ ._\\ -]+)([^/=<>~!]+)[A-Za-z0-9\\ ._\\ -\\ *\\ +\\ !]*$\
@@ -257,9 +339,19 @@ exclude_patterns = [
257339 # Putting this exclusion just to get the linter running.
258340 " tools/stronghold/bin/build-check-api-compatibility" ,
259341]
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+ ]
260350command = [
261351 ' 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' ,
263355 ' --' ,
264356 ' @{{PATHSFILE}}' ,
265357]
@@ -275,14 +367,23 @@ include_patterns = [
275367]
276368command = [
277369 ' 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+ ' --' ,
279374 ' --binary=.lintbin/actionlint' ,
280375 ' --' ,
281376 ' @{{PATHSFILE}}' ,
282377]
283378init_command = [
284379 ' 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+ ' --' ,
286387 ' --config-json=tools/linter/adapters/s3_init_config.json' ,
287388 ' --linter=actionlint' ,
288389 ' --dry-run={{DRYRUN}}' ,
@@ -299,6 +400,7 @@ include_patterns = [
299400command = [
300401 ' python3' ,
301402 ' tools/linter/adapters/run_from_link_linter.py' ,
403+ ' --run-lint' ,
302404 ' --lint-name=pyfmt_linter.py' ,
303405 ' --' ,
304406 ' @{{PATHSFILE}}'
@@ -308,9 +410,9 @@ init_command = [
308410 ' tools/linter/adapters/run_from_link_linter.py' ,
309411 ' --run-init' ,
310412 ' --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' ,
312414 ' --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' ,
314416 ' --' ,
315417 ' --dry-run={{DRYRUN}}' ,
316418 ' --no-black-binary' ,
@@ -325,9 +427,20 @@ is_formatter = true
325427code = ' COPYRIGHT'
326428include_patterns = [' **' ]
327429exclude_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+ ]
328438command = [
329439 ' 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+ ' --' ,
331444 ' --pattern=Confidential and proprietary' ,
332445 ' --linter-name=COPYRIGHT' ,
333446 ' --error-name=Confidential Code' ,
@@ -342,9 +455,19 @@ command = [
342455[[linter ]]
343456code = ' LINTRUNNER_VERSION'
344457include_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+ ]
345466command = [
346467 ' 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' ,
348471]
349472
350473[[linter ]]
@@ -360,15 +483,24 @@ exclude_patterns = [
360483]
361484command = [
362485 ' 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+ ' --' ,
364490 ' --config=pyproject.toml' ,
365491 ' --show-disable' ,
366492 ' --' ,
367493 ' @{{PATHSFILE}}'
368494]
369495init_command = [
370496 ' 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+ ' --' ,
372504 ' --dry-run={{DRYRUN}}' ,
373505 ' ruff==0.8.4' , # sync with PYFMT
374506]
@@ -384,7 +516,11 @@ command = [
384516]
385517init_command = [
386518 ' 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+ ' --' ,
388524 ' --dry-run={{DRYRUN}}' ,
389525 ' sqlfluff==3.3.0' ,
390526]
0 commit comments