-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Expand file tree
/
Copy path.lintrunner.toml
More file actions
225 lines (221 loc) · 9.26 KB
/
.lintrunner.toml
File metadata and controls
225 lines (221 loc) · 9.26 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
merge_base_with = "origin/main"
# 4805a6ead6f1e7f32351056e2602be4e908f69b7 is from pytorch/pytorch main branch 2025-07-16
[[linter]]
code = 'SPACES'
include_patterns = ['**']
exclude_patterns = [
"_static/**/*", # Contains some files that should usually not be linted
# All files below this should be checked and either removed from the
# exclusion list by fixing them or have a reason to be excluded.
"advanced_source/coding_ddpg.py",
"advanced_source/cpp_autograd.rst",
"advanced_source/cpp_custom_ops.rst",
"advanced_source/generic_join.rst",
"advanced_source/neural_style_tutorial.py",
"advanced_source/pendulum.py",
"advanced_source/privateuseone.rst",
"advanced_source/semi_structured_sparse.py",
"advanced_source/sharding.rst",
"advanced_source/torch_script_custom_classes/custom_class_project/custom_test.py",
"advanced_source/transformer__timeseries_cpp_tutorial/transformer_timeseries.cpp",
"advanced_source/usb_semisup_learn.py",
"beginner_source/blitz/README.txt",
"beginner_source/blitz/neural_networks_tutorial.py",
"beginner_source/dcgan_faces_tutorial.py",
"beginner_source/ddp_series_fault_tolerance.rst",
"beginner_source/ddp_series_theory.rst",
"beginner_source/examples_nn/polynomial_module.py",
"beginner_source/examples_nn/polynomial_nn.py",
"beginner_source/hta_intro_tutorial.rst",
"beginner_source/hta_trace_diff_tutorial.rst",
"beginner_source/hybrid_frontend/README.txt",
"beginner_source/hybrid_frontend_tutorial.rst",
"beginner_source/hyperparameter_tuning_tutorial.py",
"beginner_source/introyt/README.txt",
"beginner_source/introyt/autogradyt_tutorial.py",
"beginner_source/introyt/captumyt.py",
"beginner_source/introyt/introyt1_tutorial.py",
"beginner_source/introyt/modelsyt_tutorial.py",
"beginner_source/introyt/tensorboardyt_tutorial.py",
"beginner_source/introyt/tensors_deeper_tutorial.py",
"beginner_source/introyt/trainingyt.py",
"beginner_source/knowledge_distillation_tutorial.py",
"beginner_source/nlp/sequence_models_tutorial.py",
"beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py",
"beginner_source/onnx/onnx_registry_tutorial.py",
"beginner_source/pytorch_with_examples.rst",
"beginner_source/saving_loading_models.py",
"beginner_source/template_tutorial.py",
"beginner_source/transfer_learning_tutorial.py",
"intermediate_source/TCPStore_libuv_backend.rst",
"intermediate_source/ax_multiobjective_nas_tutorial.py",
"intermediate_source/compiled_autograd_tutorial.rst",
"intermediate_source/ddp_series_multinode.rst",
"intermediate_source/dqn_with_rnn_tutorial.py",
"intermediate_source/fx_profiling_tutorial.py",
"intermediate_source/inductor_debug_cpu.py",
"intermediate_source/jacobians_hessians.py",
"intermediate_source/optimizer_step_in_backward_tutorial.py",
"intermediate_source/per_sample_grads.py",
"intermediate_source/pruning_tutorial.py",
"intermediate_source/reinforcement_q_learning.py",
"intermediate_source/tensorboard_profiler_tutorial.py",
"intermediate_source/torch_compile_tutorial.py",
"intermediate_source/transformer_building_blocks.py",
"unstable_source/README.md",
"unstable_source/README.txt",
"unstable_source/gpu_direct_storage.py",
"unstable_source/inductor_cpp_wrapper_tutorial.rst",
"unstable_source/inductor_windows.rst",
"unstable_source/maskedtensor_advanced_semantics.py",
"unstable_source/max_autotune_on_CPU_tutorial.rst",
"unstable_source/vmap_recipe.py",
"recipes_source/README.txt",
"recipes_source/compiling_optimizer.rst",
"recipes_source/compiling_optimizer_lr_scheduler.py",
"recipes_source/distributed_optim_torchscript.rst",
"recipes_source/foreach_map.py",
"recipes_source/profile_with_itt.rst",
"recipes_source/recipes/Captum_Recipe.py",
"recipes_source/recipes/benchmark.py",
"recipes_source/recipes/changing_default_device.py",
"recipes_source/recipes/defining_a_neural_network.py",
"recipes_source/recipes/tensorboard_with_pytorch.py",
"recipes_source/recipes/timer_quick_start.py",
"recipes_source/recipes/tuning_guide.py",
"recipes_source/recipes/warmstarting_model_using_parameters_from_a_different_model.py",
"recipes_source/recipes/what_is_state_dict.py",
"recipes_source/torch_compile_caching_tutorial.rst",
"recipes_source/torch_compile_torch_function_modes.py",
"recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py",
"recipes_source/torch_compiler_set_stance_tutorial.py",
"recipes_source/torch_export_aoti_python.py",
"recipes_source/xeon_run_cpu.rst",
"advanced_source/cpp_export.rst",
"advanced_source/torch-script-parallelism.rst",
"advanced_source/torch_script_custom_classes.rst",
"advanced_source/torch_script_custom_ops.rst",
"recipes_source/torchscript_inference.rst",
]
init_command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--lint-name=grep_linter.py',
'--lint-link=https://raw.githubusercontent.com/pytorch/pytorch/4805a6ead6f1e7f32351056e2602be4e908f69b7/tools/linter/adapters/grep_linter.py',
'--',
'--dry-run={{DRYRUN}}',
]
command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--run-lint',
'--lint-name=grep_linter.py',
'--',
'--pattern=[[:blank:]]$',
'--linter-name=SPACES',
'--error-name=trailing spaces',
'--replace-pattern=s/[[:blank:]]+$//',
"""--error-description=\
This line has trailing spaces; please remove them.\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'TABS'
include_patterns = ['**']
exclude_patterns = [
"_static/**/*", # Contains some files that should usually not be linted
".lintrunner.toml", # Ironically needs to contain the tab character to find in other files
"Makefile", # Wants tabs for indentationo
# All files below this should be checked and either removed from the
# exclusion list by fixing them or have a reason to be excluded.
"advanced_source/README.txt",
"advanced_source/cpp_frontend.rst",
"advanced_source/torch_script_custom_ops.rst",
"beginner_source/README.txt",
"beginner_source/basics/tensorqs_tutorial.py",
"beginner_source/blitz/README.txt",
"beginner_source/blitz/tensor_tutorial.py",
"beginner_source/hybrid_frontend/README.txt",
"beginner_source/nlp/README.txt",
"beginner_source/nlp/pytorch_tutorial.py",
"intermediate_source/README.txt",
"intermediate_source/TP_tutorial.rst",
"intermediate_source/inductor_debug_cpu.py",
"unstable_source/README.txt",
"recipes_source/README.txt",
"recipes_source/recipes/README.txt",
"recipes_source/xeon_run_cpu.rst",
]
init_command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--lint-name=grep_linter.py',
'--lint-link=https://raw.githubusercontent.com/pytorch/pytorch/4805a6ead6f1e7f32351056e2602be4e908f69b7/tools/linter/adapters/grep_linter.py',
'--',
'--dry-run={{DRYRUN}}',
]
command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--run-lint',
'--lint-name=grep_linter.py',
'--',
# @lint-ignore TXT2
'--pattern= ',
'--linter-name=TABS',
'--error-name=saw some tabs',
'--replace-pattern=s/\t/ /',
"""--error-description=\
This line has tabs; please replace them with spaces.\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'NEWLINE'
include_patterns=['**']
exclude_patterns=[
"_static/**/*", # Contains some files that should usually not be linted
# All files below this should be checked and either removed from the
# exclusion list by fixing them or have a reason to be excluded.
"advanced_source/extend_dispatcher.rst",
"advanced_source/neural_style_tutorial.py",
"advanced_source/sharding.rst",
"advanced_source/torch_script_custom_classes/custom_class_project/custom_test.py",
"advanced_source/transformer__timeseries_cpp_tutorial/transformer_timeseries.cpp",
"beginner_source/blitz/README.txt",
"beginner_source/dcgan_faces_tutorial.py",
"beginner_source/hta_trace_diff_tutorial.rst",
"beginner_source/hybrid_frontend/README.txt",
"beginner_source/nlp/pytorch_tutorial.py",
"beginner_source/template_tutorial.py",
"beginner_source/transfer_learning_tutorial.py",
"intermediate_source/custom_function_conv_bn_tutorial.py",
"intermediate_source/custom_function_double_backward_tutorial.rst",
"intermediate_source/forced_alignment_with_torchaudio_tutorial.rst",
"intermediate_source/nlp_from_scratch_index.rst",
"intermediate_source/pipeline_tutorial.rst",
"recipes_source/README.txt",
"recipes_source/script_optimized.rst",
"recipes_source/torch_compile_caching_configuration_tutorial.rst",
"recipes_source/torch_compile_caching_tutorial.rst",
]
init_command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--lint-name=newlines_linter.py',
'--lint-link=https://raw.githubusercontent.com/pytorch/pytorch/4805a6ead6f1e7f32351056e2602be4e908f69b7/tools/linter/adapters/newlines_linter.py',
'--',
'--dry-run={{DRYRUN}}',
]
command = [
'python3',
'tools/linter/adapters/run_from_link.py',
'--run-lint',
'--lint-name=newlines_linter.py',
'--',
'@{{PATHSFILE}}',
]
is_formatter = true