File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -371,3 +371,26 @@ command = [
371
371
' --' ,
372
372
' @{{PATHSFILE}}' ,
373
373
]
374
+
375
+ [[linter ]]
376
+ code = ' TORCH_AO_IMPORT'
377
+ include_patterns = [' **/*.py' ]
378
+ exclude_patterns = [
379
+ ' third-party/**' ,
380
+ ]
381
+ command = [
382
+ ' python3' ,
383
+ ' -m' ,
384
+ ' lintrunner_adapters' ,
385
+ ' run' ,
386
+ ' grep_linter' ,
387
+ ' --pattern=\\bfrom torch.ao.quantization(\\.[a-zA-Z0-9_]+)*\\b' ,
388
+ ' --linter-name=TorchAOImport' ,
389
+ ' --error-name=Prohibited torch.ao.quantization import' ,
390
+ """ --error-description=\
391
+ Imports from torch.ao.quantization are not allowed. \
392
+ Please import from torchao.quantization.pt2e instead.\
393
+ """ ,
394
+ ' --' ,
395
+ ' @{{PATHSFILE}}' ,
396
+ ]
Original file line number Diff line number Diff line change @@ -97,3 +97,6 @@ ignore_missing_imports = True
97
97
98
98
[mypy-zstd]
99
99
ignore_missing_imports = True
100
+
101
+ [mypy-torchao.*]
102
+ follow_untyped_imports = True
You can’t perform that action at this time.
0 commit comments