Add type annotations

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-07-27 23:56:35 +02:00
1 parent 8e8f304377
commit d1afa040c4
3 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -78,7 +78,7 @@ class RuntimeDependencyCollection:
else:
import pwd
kwargs["user"] = pwd.getpwuid(os.getuid()).pw_name
kwargs["user"] = pwd.getpwuid(os.getuid()).pw_name # type: ignore
log.info("Running command '%s' in '%s'", command, cwd)
completed_process = subprocess.run(
command,
@@ -88,7 +88,7 @@ class RuntimeDependencyCollection:
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
**kwargs,
)
) # type: ignore
if completed_process.returncode != 0:
log.warning("Command '%s' failed with return code %d", command, completed_process.returncode)
log.warning("Command output:\n%s", completed_process.stdout)
+2 -2
View File
@@ -4,7 +4,7 @@ This module contains the exceptions raised by the framework.
class SolidLSPException(Exception):
def __init__(self, message: str, cause: Exception | None = None):
def __init__(self, message: str, cause: Exception | None = None) -> None:
"""
Initializes the exception with the given message.
@@ -17,7 +17,7 @@ class SolidLSPException(Exception):
self.cause = cause
super().__init__(message)
def is_language_server_terminated(self):
def is_language_server_terminated(self) -> bool:
"""
:return: True if the exception is caused by the language server having terminated as indicated
by the causing exception being an instance of LanguageServerTerminatedException.
+1 -1
View File
@@ -253,7 +253,7 @@ class PlatformId(str, Enum):
LINUX_MUSL_x64 = "linux-musl-x64"
LINUX_MUSL_arm64 = "linux-musl-arm64"
def is_windows(self):
def is_windows(self) -> bool:
return self.value.startswith("win")