Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Jul 24, 2024
1 parent eba4c0e commit 4ba3250
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pylsp/python_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,17 @@ def lint(self, doc_uri, is_saved):
workspace = self._match_uri_to_workspace(doc_uri)
document_object = workspace.documents.get(doc_uri, None)
if isinstance(document_object, Document):
self._lint_text_document(doc_uri, workspace, is_saved, document_object.version)
self._lint_text_document(
doc_uri, workspace, is_saved, document_object.version
)
elif isinstance(document_object, Notebook):
self._lint_notebook_document(document_object, workspace)

def _lint_text_document(self, doc_uri, workspace, is_saved, doc_version=None):
workspace.publish_diagnostics(
doc_uri, flatten(self._hook("pylsp_lint", doc_uri, is_saved=is_saved)), doc_version,
doc_uri,
flatten(self._hook("pylsp_lint", doc_uri, is_saved=is_saved)),
doc_version,
)

def _lint_notebook_document(self, notebook_document, workspace):
Expand Down
2 changes: 1 addition & 1 deletion pylsp/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _progress_end(self, token: str, message: Optional[str] = None) -> None:
"value": value,
},
)

def log_message(self, message, msg_type=lsp.MessageType.Info):
self._endpoint.notify(
self.M_LOG_MESSAGE, params={"type": msg_type, "message": message}
Expand Down

0 comments on commit 4ba3250

Please sign in to comment.