Skip to content

Commit a383394

Browse files
committed
Fix lint issues
1 parent 4424a5a commit a383394

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Diff for: pylsp/plugins/flake8_lint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def run_flake8(flake8_executable, args, document):
8181
try:
8282
cmd = [flake8_executable]
8383
cmd.extend(args)
84-
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
84+
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
8585
except IOError:
8686
log.debug("Can't execute %s. Trying with '%s -m flake8'", flake8_executable, sys.executable)
8787
cmd = [sys.executable, '-m', 'flake8']

Diff for: pylsp/plugins/pylint_lint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _run_pylint_stdio(pylint_executable, document, flags):
246246
cmd = [pylint_executable]
247247
cmd.extend(flags)
248248
cmd.extend(['--from-stdin', document.path])
249-
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) # pylint: disable=consider-using-with
249+
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
250250
except IOError:
251251
log.debug("Can't execute %s. Trying with 'python -m pylint'", pylint_executable)
252252
cmd = ['python', '-m', 'pylint']

Diff for: test/plugins/test_flake8_lint.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def test_flake8_unsaved(workspace):
4343

4444

4545
def test_flake8_lint(workspace):
46+
name, doc = temp_document(DOC, workspace)
4647
try:
47-
name, doc = temp_document(DOC, workspace)
4848
diags = flake8_lint.pylsp_lint(workspace, doc)
4949
msg = 'F841 local variable \'a\' is assigned to but never used'
5050
unused_var = [d for d in diags if d['message'] == msg][0]
@@ -54,7 +54,6 @@ def test_flake8_lint(workspace):
5454
assert unused_var['range']['start'] == {'line': 5, 'character': 1}
5555
assert unused_var['range']['end'] == {'line': 5, 'character': 11}
5656
assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning
57-
5857
finally:
5958
os.remove(name)
6059

0 commit comments

Comments
 (0)