31
31
# Returning an empty diagnostic clears the diagnostic result,
32
32
# so store a cache of last diagnostics for each file a-la the pylint plugin,
33
33
# so we can return some potentially-stale diagnostics.
34
- # https://github.com/palantir /python-language -server/blob/0.36.2/pyls /plugins/pylint_lint.py#L52-L59
34
+ # https://github.com/python-lsp /python-lsp -server/blob/v1.0.1/pylsp /plugins/pylint_lint.py#L55-L62
35
35
last_diagnostics : Dict [str , List ] = collections .defaultdict (list )
36
36
37
37
def parse_line (line : str , document : Optional [Document ] = None ) -> Optional [Dict [str , Any ]]:
@@ -168,25 +168,25 @@ def pyls_lint(config: Config, workspace: Workspace, document: Document,
168
168
"silent"
169
169
])
170
170
171
- log .info (f"executing mypy args= { args } " )
171
+ log .info (f"executing mypy args = %s" , args )
172
172
report , errors , _ = mypy_api .run (args )
173
173
else :
174
174
args = ["run" , "--" ] + args
175
175
176
176
log .info (f"executing dmypy args={ args } " )
177
177
report , errors , _ = mypy_api .run_dmypy (args )
178
178
179
- log .debug ("report: \n " + report )
179
+ log .debug ("report:\n %s" , report )
180
180
log .debug ("errors: \n " + errors )
181
181
182
182
diagnostics = []
183
183
for line in report .splitlines ():
184
- log .debug (f"parsing: line= { line } " )
184
+ log .debug (f"parsing: line = %r" , line )
185
185
diag = parse_line (line , document )
186
186
if diag :
187
187
diagnostics .append (diag )
188
188
189
- logging .info ("mypy-ls len(diagnostics) = %s" , len (diagnostics ))
189
+ log .info ("mypy-ls len(diagnostics) = %s" , len (diagnostics ))
190
190
191
191
last_diagnostics [document .path ] = diagnostics
192
192
return diagnostics
@@ -228,7 +228,7 @@ def init(workspace: str) -> Dict[str, str]:
228
228
229
229
"""
230
230
# On windows the path contains \\ on linux it contains / all the code works with /
231
- log .info (f"init workspace= { workspace } " )
231
+ log .info (f"init workspace = %s" , workspace )
232
232
workspace = workspace .replace ("\\ " , "/" )
233
233
234
234
configuration = {}
@@ -248,7 +248,7 @@ def init(workspace: str) -> Dict[str, str]:
248
248
tmpFile = tempfile .NamedTemporaryFile ('w' , delete = False )
249
249
tmpFile .close ()
250
250
251
- log .info (f"mypyConfigFile= { mypyConfigFile } configuration= { configuration } " )
251
+ log .info (f"mypyConfigFile = %s configuration = %s" , mypyConfigFile , configuration )
252
252
return configuration
253
253
254
254
0 commit comments