forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.lintrunner.toml
119 lines (113 loc) · 2.54 KB
/
.lintrunner.toml
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
[[linter]]
name = 'FLAKE8'
include_patterns = ['**/*.py']
exclude_patterns = [
'.git/**',
'build_code_analyzer',
'build_test_custom_build/**',
'build/**',
'caffe2/**',
'docs/caffe2/**',
'docs/cpp/src/**',
'docs/src/**',
'scripts/**',
'test/generated_type_hints_smoketest.py',
'third_party/**',
'torch/include/**',
'torch/lib/**',
'venv/**',
'**/*.pyi',
]
args = [
'python3',
'tools/linter/adapters/flake8_linter.py',
'--binary=flake8',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
name = 'CLANGFORMAT'
include_patterns = [
'c10/**/*.h',
'c10/**/*.cpp',
'torch/csrc/jit/**/*.h',
'torch/csrc/jit/**/*.cpp',
'torch/csrc/deploy/**/*.h',
'torch/csrc/deploy/**/*.cpp',
'test/cpp/jit/**/*.h',
'test/cpp/jit/**/*.cpp',
'test/cpp/tensorexpr/**/*.h',
'test/cpp/tensorexpr/**/*.cpp',
]
exclude_patterns = []
args = [
'python3',
'tools/linter/adapters/clangformat_linter.py',
'--binary=clang-format',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
name = 'MYPY'
include_patterns = ['**/*.py']
exclude_patterns = []
args = [
'python3',
'tools/linter/adapters/mypy_linter.py',
'--binary=mypy',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
name = 'CLANGTIDY'
include_patterns = ['**/*.cpp']
exclude_patterns = []
init_args = [
'python3',
'tools/linter/adapters/clangtidy_init.py',
'--dry_run={{DRYRUN}}',
'--output_dir=.clang-tidy-bin',
'--output_name=clang-tidy',
]
args = [
'python3',
'tools/linter/adapters/clangtidy_linter.py',
'--binary=.clang-tidy-bin/clang-tidy',
'--build_dir=./build',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
name = 'TYPEIGNORE'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = ['test/test_jit.py']
args = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=# type:\s*ignore(?!\[)',
'--linter_name=TYPEIGNORE',
'--error_name=unqualified type: ignore',
"""--error_description=\
This line has an unqualified `type: ignore`; \
please convert it to `type: ignore[xxxx]`\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
name = 'NOQA'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = ['caffe2/**']
args = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=# type:\s*ignore(?!\[)',
'--linter_name=TYPEIGNORE',
'--error_name=unqualified noqa',
"""--error_description=\
This line has an unqualified `noqa`; \
please convert it to `noqa: XXXX`\
""",
'--',
'@{{PATHSFILE}}'
]