Skip to content

Commit d08cd54

Browse files
committed
Update style to match new pylint suggestions
1 parent 03cda4e commit d08cd54

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Diff for: pylsp/plugins/jedi_completion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def use_snippets(document, position):
114114
break
115115
if '(' in act_lines[-1].strip():
116116
last_character = ')'
117-
code = '\n'.join(act_lines).split(';')[-1].strip() + last_character
117+
code = '\n'.join(act_lines).rsplit(';', maxsplit=1)[-1].strip() + last_character
118118
tokens = parso.parse(code)
119119
expr_type = tokens.children[0].type
120120
return (expr_type not in _IMPORTS and

Diff for: pylsp/python_lsp.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ def m_text_document__signature_help(self, textDocument=None, position=None, **_k
363363

364364
def m_workspace__did_change_configuration(self, settings=None):
365365
self.config.update((settings or {}).get('pylsp', {}))
366-
for workspace_uri in self.workspaces:
367-
workspace = self.workspaces[workspace_uri]
366+
for workspace in self.workspaces.values():
368367
workspace.update_config(settings)
369368
for doc_uri in workspace.documents:
370369
self.lint(doc_uri, is_saved=False)
@@ -433,8 +432,7 @@ def m_workspace__did_change_watched_files(self, changes=None, **_kwargs):
433432
# Only externally changed python files and lint configs may result in changed diagnostics.
434433
return
435434

436-
for workspace_uri in self.workspaces:
437-
workspace = self.workspaces[workspace_uri]
435+
for workspace in self.workspaces.values():
438436
for doc_uri in workspace.documents:
439437
# Changes in doc_uri are already handled by m_text_document__did_save
440438
if doc_uri not in changed_py_files:

Diff for: test/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Copyright 2021- Python Language Server Contributors.
33

44
import time
5+
from unittest import mock
56

6-
import unittest.mock as mock
77
from flaky import flaky
88

99
from pylsp import _utils

0 commit comments

Comments
 (0)