Skip to content

Commit 07c1015

Browse files
authored
Apply suggestions from code review
1 parent 61b8455 commit 07c1015

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Depending on your editor, the configuration (found in a file called mypy-ls.cfg
3838

3939
``dmypy`` (default is False) executes via `dmypy run` rather than `mypy`.
4040

41-
This uses the `dmypy` daemon and may dramatically improve the responsiveness of the `pyls` server.
41+
This uses the `dmypy` daemon and may dramatically improve the responsiveness of the `pylsp` server.
4242

4343
Depending on your editor, the configuration (found in a file called mypy-ls.cfg in your workspace or a parent directory) should be roughly like this:
4444

mypy_ls/plugin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Returning an empty diagnostic clears the diagnostic result,
3232
# so store a cache of last diagnostics for each file a-la the pylint plugin,
3333
# 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
3535
last_diagnostics : Dict[str, List] = collections.defaultdict(list)
3636

3737
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,
168168
"silent"
169169
])
170170

171-
log.info(f"executing mypy args={args}")
171+
log.info(f"executing mypy args = %s", args)
172172
report, errors, _ = mypy_api.run(args)
173173
else:
174174
args = ["run", "--"] + args
175175

176176
log.info(f"executing dmypy args={args}")
177177
report, errors, _ = mypy_api.run_dmypy(args)
178178

179-
log.debug("report: \n" + report)
179+
log.debug("report:\n%s", report)
180180
log.debug("errors: \n" + errors)
181181

182182
diagnostics = []
183183
for line in report.splitlines():
184-
log.debug(f"parsing: line={line}")
184+
log.debug(f"parsing: line = %r", line)
185185
diag = parse_line(line, document)
186186
if diag:
187187
diagnostics.append(diag)
188188

189-
logging.info("mypy-ls len(diagnostics) = %s", len(diagnostics))
189+
log.info("mypy-ls len(diagnostics) = %s", len(diagnostics))
190190

191191
last_diagnostics[document.path] = diagnostics
192192
return diagnostics
@@ -228,7 +228,7 @@ def init(workspace: str) -> Dict[str, str]:
228228
229229
"""
230230
# 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)
232232
workspace = workspace.replace("\\", "/")
233233

234234
configuration = {}
@@ -248,7 +248,7 @@ def init(workspace: str) -> Dict[str, str]:
248248
tmpFile = tempfile.NamedTemporaryFile('w', delete=False)
249249
tmpFile.close()
250250

251-
log.info(f"mypyConfigFile={mypyConfigFile} configuration={configuration}")
251+
log.info(f"mypyConfigFile = %s configuration = %s", mypyConfigFile, configuration)
252252
return configuration
253253

254254

0 commit comments

Comments
 (0)