forked from microsoft/onnxscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.lintrunner.toml
156 lines (151 loc) · 3.04 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
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
# Configuration for lintrunner https://github.com/suo/lintrunner
merge_base_with = 'main'
[[linter]]
code = 'RUFF'
include_patterns = [
'**/*.py',
'**/*.pyi',
]
exclude_patterns = [
'onnxscript/tests/models/**',
]
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'ruff_linter',
'--config=pyproject.toml',
'@{{PATHSFILE}}'
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'--requirement=requirements/lintrunner/requirements.txt',
]
is_formatter = true
[[linter]]
code = 'MYPY'
include_patterns = [
'onnxscript/**/*.py',
'onnxscript/**/*.pyi',
]
exclude_patterns = [
# FIXME: Fix typing annotations in these files
'onnxscript/converter_test.py',
'onnxscript/converter.py',
'onnxscript/evaluator_test.py',
'onnxscript/evaluator.py',
'onnxscript/onnx_types.py',
'onnxscript/tests/**', # Skip linting test files for speed
'onnxscript/**/*_test.py', # Skip linting test files for speed
'onnxscript/function_libs/torch_lib/ops/**', # Operators typing do not play well with mypy
]
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'mypy_linter',
'--config=pyproject.toml',
'--show-disable',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'--requirement=requirements/lintrunner/requirements.txt',
]
[[linter]]
code = 'RUFF-FORMAT'
include_patterns = [
'**/*.py',
]
exclude_patterns = [
'onnxscript/tests/onnx_backend_test_code/**',
]
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'ruff_format_linter',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'--requirement=requirements/lintrunner/requirements.txt',
]
is_formatter = true
[[linter]]
code = 'PYLINT'
include_patterns = [
'**/*.py',
]
exclude_patterns = [
'docs/examples/**',
'docs/tutorial/examples/**',
'onnxscript/converter_test.py',
'onnxscript/tests/functions/**',
'onnxscript/tests/models/**',
'onnxscript/tests/onnx_backend_test_code/**',
]
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pylint_linter',
'--rcfile=pyproject_pylint.toml',
'--show-disable',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'--requirement=requirements/lintrunner/requirements.txt',
]
[[linter]]
code = 'EDITORCONFIG-CHECKER'
include_patterns = ['**']
exclude_patterns = [
'**/*.ipynb',
]
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'editorconfig_checker_linter',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'--requirement=requirements/lintrunner/requirements.txt',
]