Skip to content

Commit

Permalink
address pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrabel-db committed Aug 15, 2023
1 parent 2e73160 commit 4b8f955
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pylsp/plugins/pylint_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def _run_pylint_stdio(pylint_executable, document, flags):
cmd = ["python", "-m", "pylint"]
cmd.extend(flags)
cmd.extend(["--from-stdin", document.path])
p = Popen(
p = Popen( # pylint: disable=consider-using-with
cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE
) # pylint: disable=consider-using-with
)
(stdout, stderr) = p.communicate(document.source.encode())
if stderr:
log.error("Error while running pylint '%s'", stderr.decode())
Expand Down
5 changes: 2 additions & 3 deletions pylsp/plugins/rope_autoimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def pylsp_settings() -> Dict[str, Dict[str, Dict[str, Any]]]:
return {"plugins": {"rope_autoimport": {"enabled": False, "memory": False}}}


def _should_insert(
expr: tree.BaseNode, word_node: tree.Leaf
) -> bool: # pylint: disable=too-many-return-statements
# pylint: disable=too-many-return-statements
def _should_insert(expr: tree.BaseNode, word_node: tree.Leaf) -> bool:
"""
Check if we should insert the word_node on the given expr.
Expand Down
2 changes: 1 addition & 1 deletion scripts/jsonschema2md.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def describe_type(prop: dict) -> str:
prop_type = types[0]
parts = [f"`{prop_type}`"]
for option in types:
if option in EXTRA_DESCRIPTORS:
if option in EXTRA_DESCRIPTORS:
parts.append(EXTRA_DESCRIPTORS[option](prop))
if "enum" in prop:
allowed_values = [f"`{value!r}`" for value in prop["enum"]]
Expand Down
6 changes: 4 additions & 2 deletions test/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ def test_workspace_loads_pycodestyle_config(pylsp, tmpdir):
# Test that project settings are loaded
workspace2_dir = tmpdir.mkdir("NewTest456")
cfg = workspace2_dir.join("pycodestyle.cfg")
cfg.write("[pycodestyle]\n" "max-line-length = 1000") # pylint: disable=implicit-str-concat
# pylint: disable=implicit-str-concat
cfg.write("[pycodestyle]\n" "max-line-length = 1000")

workspace1 = {"uri": str(workspace1_dir)}
workspace2 = {"uri": str(workspace2_dir)}
Expand All @@ -256,7 +257,8 @@ def test_workspace_loads_pycodestyle_config(pylsp, tmpdir):
# Test switching to another workspace with different settings
workspace3_dir = tmpdir.mkdir("NewTest789")
cfg1 = workspace3_dir.join("pycodestyle.cfg")
cfg1.write("[pycodestyle]\n" "max-line-length = 20") # pylint: disable=implicit-str-concat
# pylint: disable=implicit-str-concat
cfg1.write("[pycodestyle]\n" "max-line-length = 20")

workspace3 = {"uri": str(workspace3_dir)}

Expand Down

0 comments on commit 4b8f955

Please sign in to comment.