Skip to content

Fix or silence pylint warnings in test_lint_free_pylint test #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pylsp/plugins/pylint_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def lint(cls, document, is_saved, flags=''):
# * warning
diagnostics = []
for diag in json.loads(json_out):
log.debug("Pylint raw output entry: %s", diag)
# pylint lines index from 1, pylsp lines index from 0
line = diag['line'] - 1

Expand Down
5 changes: 3 additions & 2 deletions test/plugins/test_pylint_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ def test_lint_free_pylint(config, workspace):
# Can't use temp_document because it might give us a file that doesn't
# match pylint's naming requirements. We should be keeping this file clean
# though, so it works for a test of an empty lint.
ws = Workspace(str(Path(__file__).absolute().parents[2]), workspace._endpoint)
# pylint: disable-next=protected-access
wksp = Workspace(str(Path(__file__).absolute().parents[2]), workspace._endpoint)
assert not pylint_lint.pylsp_lint(
config, ws, Document(uris.from_fs_path(__file__), ws), True)
config, wksp, Document(uris.from_fs_path(__file__), wksp), True)


def test_lint_caching(workspace):
Expand Down