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 @@ -378,3 +378,26 @@ command = [
378
378
' --' ,
379
379
' @{{PATHSFILE}}' ,
380
380
]
381
+
382
+ [[linter ]]
383
+ code = ' TORCH_AO_IMPORT'
384
+ include_patterns = [' **/*.py' ]
385
+ exclude_patterns = [
386
+ ' third-party/**' ,
387
+ ]
388
+ command = [
389
+ ' python3' ,
390
+ ' -m' ,
391
+ ' lintrunner_adapters' ,
392
+ ' run' ,
393
+ ' grep_linter' ,
394
+ ' --pattern=\\bfrom torch.ao.quantization(\\.[a-zA-Z0-9_]+)*\\b' ,
395
+ ' --linter-name=TorchAOImport' ,
396
+ ' --error-name=Prohibited torch.ao.quantization import' ,
397
+ """ --error-description=\
398
+ Imports from torch.ao.quantization are not allowed. \
399
+ Please import from torchao.quantization.pt2e instead.\
400
+ """ ,
401
+ ' --' ,
402
+ ' @{{PATHSFILE}}' ,
403
+ ]
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