Skip to content

Commit 8377245

Browse files
committed
up
1 parent 7cf58da commit 8377245

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.lintrunner.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,3 +378,26 @@ command = [
378378
'--',
379379
'@{{PATHSFILE}}',
380380
]
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+
]

.mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,6 @@ ignore_missing_imports = True
9797

9898
[mypy-zstd]
9999
ignore_missing_imports = True
100+
101+
[mypy-torchao.*]
102+
follow_untyped_imports = True

0 commit comments

Comments
 (0)