File tree 1 file changed +0
-77
lines changed
1 file changed +0
-77
lines changed Original file line number Diff line number Diff line change @@ -159,83 +159,6 @@ def format_lint_message(
159
159
return message
160
160
161
161
162
- # def check_files(
163
- # filenames: list[str],
164
- # *,
165
- # config: str | None,
166
- # retries: int,
167
- # timeout: int,
168
- # explain: bool,
169
- # show_disable: bool,
170
- # ) -> list[LintMessage]:
171
- try :
172
- proc = run_command (
173
- [
174
- "clickhouse-format" ,
175
- "--query" ,
176
- '"' ,
177
- * filenames ,
178
- '"' ,
179
- ],
180
- retries = retries ,
181
- timeout = timeout ,
182
- check = True ,
183
- )
184
- except (OSError , subprocess .CalledProcessError ) as err :
185
- return [
186
- LintMessage (
187
- path = None ,
188
- line = None ,
189
- char = None ,
190
- code = LINTER_CODE ,
191
- name = "command-failed" ,
192
- original = None ,
193
- replacement = None ,
194
- description = (
195
- f"Failed due to { err .__class__ .__name__ } :\n { err } "
196
- if not isinstance (err , subprocess .CalledProcessError )
197
- else (
198
- f"COMMAND (exit code { err .returncode } )\n "
199
- f"{ ' ' .join (as_posix (x ) for x in err .cmd )} \n \n "
200
- f"STDERR\n { err .stderr .decode ('utf-8' ).strip () or '(empty)' } \n \n "
201
- f"STDOUT\n { err .stdout .decode ('utf-8' ).strip () or '(empty)' } "
202
- )
203
- ),
204
- )
205
- ]
206
-
207
- stdout = str (proc .stdout , "utf-8" ).strip ()
208
- vulnerabilities = json .loads (stdout )
209
-
210
- if explain :
211
- all_codes = {v ["code" ] for v in vulnerabilities }
212
- rules = {code : explain_rule (code ) for code in all_codes }
213
- else :
214
- rules = {}
215
-
216
- def lint_message (vuln : dict [str , Any ]) -> LintMessage :
217
- code = vuln ["code" ]
218
- return LintMessage (
219
- path = vuln ["filename" ],
220
- name = code ,
221
- description = (
222
- format_lint_message (
223
- vuln ["message" ],
224
- code ,
225
- rules ,
226
- show_disable and bool (vuln ["code" ]),
227
- )
228
- ),
229
- line = int (vuln ["location" ]["row" ]),
230
- char = int (vuln ["location" ]["column" ]),
231
- code = LINTER_CODE ,
232
- original = None ,
233
- replacement = None ,
234
- )
235
-
236
- return [lint_message (v ) for v in vulnerabilities ]
237
-
238
-
239
162
def check_file_for_fixes (
240
163
filename : str ,
241
164
* ,
You can’t perform that action at this time.
0 commit comments