Add some missing type annotations for return values (#3486)

This commit is contained in:
correctmost 2025-05-19 17:37:35 -04:00 committed by GitHub
parent 97eeef8c76
commit a945606834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -108,7 +108,7 @@ def encrypt(password: str, data: str) -> str:
return f"$argon2id${encoded_salt}${encoded_token}" return f"$argon2id${encoded_salt}${encoded_token}"
def decrypt(data: str, password: str): def decrypt(data: str, password: str) -> str:
_, algo, encoded_salt, encoded_token = data.split("$") _, algo, encoded_salt, encoded_token = data.split("$")
salt = base64.urlsafe_b64decode(encoded_salt) salt = base64.urlsafe_b64decode(encoded_salt)
token = base64.urlsafe_b64decode(encoded_token) token = base64.urlsafe_b64decode(encoded_token)

View File

@ -1513,7 +1513,7 @@ class Installer:
if not self.mkinitcpio(["-P"]): if not self.mkinitcpio(["-P"]):
error("Error generating initramfs (continuing anyway)") error("Error generating initramfs (continuing anyway)")
def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False): def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False) -> None:
""" """
Adds a bootloader to the installation instance. Adds a bootloader to the installation instance.
Archinstall supports one of three types: Archinstall supports one of three types:
@ -1530,7 +1530,7 @@ class Installer:
# Allow plugins to override the boot-loader handling. # Allow plugins to override the boot-loader handling.
# This allows for bot configuring and installing bootloaders. # This allows for bot configuring and installing bootloaders.
if plugin.on_add_bootloader(self): if plugin.on_add_bootloader(self):
return True return
efi_partition = self._get_efi_partition() efi_partition = self._get_efi_partition()
boot_partition = self._get_boot_partition() boot_partition = self._get_boot_partition()
@ -1560,7 +1560,7 @@ class Installer:
def add_additional_packages(self, packages: str | list[str]) -> None: def add_additional_packages(self, packages: str | list[str]) -> None:
return self.pacman.strap(packages) return self.pacman.strap(packages)
def enable_sudo(self, user: User, group: bool = False): def enable_sudo(self, user: User, group: bool = False) -> None:
info(f"Enabling sudo permissions for {user.username}") info(f"Enabling sudo permissions for {user.username}")
sudoers_dir = self.target / "etc/sudoers.d" sudoers_dir = self.target / "etc/sudoers.d"

View File

@ -336,12 +336,12 @@ def select_mirror_regions(preset: list[MirrorRegion]) -> list[MirrorRegion]:
return selected_mirrors return selected_mirrors
def add_custom_mirror_servers(preset: list[CustomServer] = []): def add_custom_mirror_servers(preset: list[CustomServer] = []) -> list[CustomServer]:
custom_mirrors = CustomMirrorServersList(preset).run() custom_mirrors = CustomMirrorServersList(preset).run()
return custom_mirrors return custom_mirrors
def select_custom_mirror(preset: list[CustomRepository] = []): def select_custom_mirror(preset: list[CustomRepository] = []) -> list[CustomRepository]:
custom_mirrors = CustomMirrorRepositoriesList(preset).run() custom_mirrors = CustomMirrorRepositoriesList(preset).run()
return custom_mirrors return custom_mirrors

View File

@ -132,7 +132,7 @@ class Password:
return self._plaintext return self._plaintext
@plaintext.setter @plaintext.setter
def plaintext(self, value: str): def plaintext(self, value: str) -> None:
self._plaintext = value self._plaintext = value
self.enc_password = crypt_yescrypt(value) self.enc_password = crypt_yescrypt(value)