From dda3d616c83455e921e7ee37cf8b8ccbabd5a7d3 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Mon, 19 May 2025 12:06:00 -0400 Subject: [PATCH] Add some missing type annotations for return values --- archinstall/lib/crypt.py | 2 +- archinstall/lib/installer.py | 6 +++--- archinstall/lib/mirrors.py | 4 ++-- archinstall/lib/models/users.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/archinstall/lib/crypt.py b/archinstall/lib/crypt.py index e0e5df90cd..fc54ac0b4f 100644 --- a/archinstall/lib/crypt.py +++ b/archinstall/lib/crypt.py @@ -108,7 +108,7 @@ def encrypt(password: str, data: str) -> str: 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("$") salt = base64.urlsafe_b64decode(encoded_salt) token = base64.urlsafe_b64decode(encoded_token) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index dd90271dfb..20d65c5b11 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1513,7 +1513,7 @@ def _config_uki( if not self.mkinitcpio(["-P"]): 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. Archinstall supports one of three types: @@ -1530,7 +1530,7 @@ def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False): # Allow plugins to override the boot-loader handling. # This allows for bot configuring and installing bootloaders. if plugin.on_add_bootloader(self): - return True + return efi_partition = self._get_efi_partition() boot_partition = self._get_boot_partition() @@ -1560,7 +1560,7 @@ def add_bootloader(self, bootloader: Bootloader, uki_enabled: bool = False): def add_additional_packages(self, packages: str | list[str]) -> None: 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}") sudoers_dir = self.target / "etc/sudoers.d" diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index a2c166d31e..7a89998680 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -336,12 +336,12 @@ def select_mirror_regions(preset: list[MirrorRegion]) -> list[MirrorRegion]: 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() return custom_mirrors -def select_custom_mirror(preset: list[CustomRepository] = []): +def select_custom_mirror(preset: list[CustomRepository] = []) -> list[CustomRepository]: custom_mirrors = CustomMirrorRepositoriesList(preset).run() return custom_mirrors diff --git a/archinstall/lib/models/users.py b/archinstall/lib/models/users.py index aab93f3e02..2c4973c167 100644 --- a/archinstall/lib/models/users.py +++ b/archinstall/lib/models/users.py @@ -132,7 +132,7 @@ def plaintext(self) -> str: return self._plaintext @plaintext.setter - def plaintext(self, value: str): + def plaintext(self, value: str) -> None: self._plaintext = value self.enc_password = crypt_yescrypt(value)