Typo and grammar fixes (#3970)

* Menu now filters and sorts using priority, improving UX.

* Refactor: improve logic, removed redundancy

* Refactor: improve logic, removed redundancy

* Typo and grammar fixes

* Typo and grammar fixes

* Fix comment formatting in .gitlab-ci.yml

* Fix comment

* Removed code from separate pull request

* Update menu_item.py

* removed white space

* Remove unnecessary blank lines in menu_item.py

>:(
This commit is contained in:
Gabriel A Hernandez 2025-12-06 01:06:07 -08:00 committed by GitHub
parent d176b9514c
commit 7398e2785d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 35 additions and 35 deletions

View File

@ -36,7 +36,7 @@ flake8:
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# We currently do not have unit tests implemented but this stage is written in anticipation of their future usage. # We currently do not have unit tests implemented but this stage is written in anticipation of their future usage.
# When a stage name is preceeded with a '.' it's treated as "disabled" by GitLab and is not executed, so it's fine for it to be declared. # When a stage name is preceded with a '.' it's treated as "disabled" by GitLab and is not executed, so it's fine for it to be declared.
.pytest: .pytest:
stage: test stage: test
tags: tags:

View File

@ -62,7 +62,7 @@ archinstall --config <path to user config file or URL> --creds <path to user cre
``` ```
### Credentials configuration file encryption ### Credentials configuration file encryption
By default all user account credentials are hashed with `yescrypt` and only the hash is stored in the saved `user_credentials.json` file. By default, all user account credentials are hashed with `yescrypt` and only the hash is stored in the saved `user_credentials.json` file.
This is not possible for disk encryption password which needs to be stored in plaintext to be able to apply it. This is not possible for disk encryption password which needs to be stored in plaintext to be able to apply it.
However, when selecting to save configuration files, `archinstall` will prompt for the option to encrypt the `user_credentials.json` file content. However, when selecting to save configuration files, `archinstall` will prompt for the option to encrypt the `user_credentials.json` file content.
@ -75,7 +75,7 @@ there are multiple ways to provide the decryption key:
# Help or Issues # Help or Issues
If you come across any issues, kindly submit your issue here on Github or post your query in the If you come across any issues, kindly submit your issue here on GitHub or post your query in the
[discord](https://discord.gg/aDeMffrxNg) help channel. [discord](https://discord.gg/aDeMffrxNg) help channel.
When submitting an issue, please: When submitting an issue, please:

View File

@ -138,7 +138,7 @@ def run_as_a_module() -> None:
text = ( text = (
'Archinstall experienced the above error. If you think this is a bug, please report it to\n' 'Archinstall experienced the above error. If you think this is a bug, please report it to\n'
'https://github.com/archlinux/archinstall and include the log file "/var/log/archinstall/install.log".\n\n' 'https://github.com/archlinux/archinstall and include the log file "/var/log/archinstall/install.log".\n\n'
"Hint: To extract the log from a live ISO \ncurl -F'file=@/var/log/archinstall/install.log' https://0x0.st\n" "Hint: To extract the log from a live ISO \ncurl -F 'file=@/var/log/archinstall/install.log' https://0x0.st\n"
) )
warn(text) warn(text)

View File

@ -4,7 +4,7 @@ from archinstall.default_profiles.profile import GreeterType, ProfileType
from archinstall.default_profiles.xorg import XorgProfile from archinstall.default_profiles.xorg import XorgProfile
class EnlighenmentProfile(XorgProfile): class EnlightenmentProfile(XorgProfile):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__('Enlightenment', ProfileType.WindowMgr) super().__init__('Enlightenment', ProfileType.WindowMgr)

View File

@ -19,8 +19,8 @@ class ApplicationMenu(AbstractSubMenu[ApplicationConfiguration]):
else: else:
self._app_config = ApplicationConfiguration() self._app_config = ApplicationConfiguration()
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, checkmarks=True) self._item_group = MenuItemGroup(menu_options, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -232,7 +232,7 @@ class ArchConfig:
arch_config.auth_config = AuthenticationConfiguration() arch_config.auth_config = AuthenticationConfiguration()
arch_config.auth_config.root_enc_password = root_password arch_config.auth_config.root_enc_password = root_password
# DEPRECATED: backwards copatibility # DEPRECATED: backwards compatibility
users: list[User] = [] users: list[User] = []
if args_users := args_config.get('!users', None): if args_users := args_config.get('!users', None):
users = User.parse_arguments(args_users) users = User.parse_arguments(args_users)

View File

@ -21,8 +21,8 @@ class AuthenticationMenu(AbstractSubMenu[AuthenticationConfiguration]):
else: else:
self._auth_config = AuthenticationConfiguration() self._auth_config = AuthenticationConfiguration()
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, checkmarks=True) self._item_group = MenuItemGroup(menu_options, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -48,7 +48,7 @@ def crypt_gen_salt(prefix: str | bytes, rounds: int) -> bytes:
def crypt_yescrypt(plaintext: str) -> str: def crypt_yescrypt(plaintext: str) -> str:
""" """
By default chpasswd in Arch uses PAM to to hash the password with crypt_yescrypt By default chpasswd in Arch uses PAM to hash the password with crypt_yescrypt
the PAM code https://github.com/linux-pam/linux-pam/blob/master/modules/pam_unix/support.c the PAM code https://github.com/linux-pam/linux-pam/blob/master/modules/pam_unix/support.c
shows that the hashing rounds are determined from YESCRYPT_COST_FACTOR in /etc/login.defs shows that the hashing rounds are determined from YESCRYPT_COST_FACTOR in /etc/login.defs
If no value was specified (or commented out) a default of 5 is choosen If no value was specified (or commented out) a default of 5 is choosen

View File

@ -51,8 +51,8 @@ class DiskLayoutConfigurationMenu(AbstractSubMenu[DiskLayoutConfiguration]):
btrfs_snapshot_config=snapshot_config, btrfs_snapshot_config=snapshot_config,
) )
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, sort_items=False, checkmarks=True) self._item_group = MenuItemGroup(menu_options, sort_items=False, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -39,8 +39,8 @@ class DiskEncryptionMenu(AbstractSubMenu[DiskEncryption]):
self._device_modifications = device_modifications self._device_modifications = device_modifications
self._lvm_config = lvm_config self._lvm_config = lvm_config
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, sort_items=False, checkmarks=True) self._item_group = MenuItemGroup(menu_options, sort_items=False, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -41,10 +41,10 @@ from .translationhandler import Language, tr, translation_handler
class GlobalMenu(AbstractMenu[None]): class GlobalMenu(AbstractMenu[None]):
def __init__(self, arch_config: ArchConfig) -> None: def __init__(self, arch_config: ArchConfig) -> None:
self._arch_config = arch_config self._arch_config = arch_config
menu_optioons = self._get_menu_options() menu_options = self._get_menu_options()
self._item_group = MenuItemGroup( self._item_group = MenuItemGroup(
menu_optioons, menu_options,
sort_items=False, sort_items=False,
checkmarks=True, checkmarks=True,
) )

View File

@ -132,7 +132,7 @@ class Installer:
self.sync_log_to_install_medium() self.sync_log_to_install_medium()
# We avoid printing /mnt/<log path> because that might confuse people if they note it down # We avoid printing /mnt/<log path> because that might confuse people if they note it down
# and then reboot, and a identical log file will be found in the ISO medium anyway. # and then reboot, and an identical log file will be found in the ISO medium anyway.
Tui.print(str(tr('[!] A log file has been created here: {}').format(logger.path))) Tui.print(str(tr('[!] A log file has been created here: {}').format(logger.path)))
Tui.print(tr('Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues')) Tui.print(tr('Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues'))

View File

@ -46,7 +46,7 @@ def select_kernel(preset: list[str] = []) -> list[str]:
def select_driver(options: list[GfxDriver] = [], preset: GfxDriver | None = None) -> GfxDriver | None: def select_driver(options: list[GfxDriver] = [], preset: GfxDriver | None = None) -> GfxDriver | None:
""" """
Some what convoluted function, whose job is simple. Somewhat convoluted function, whose job is simple.
Select a graphics driver from a pre-defined set of popular options. Select a graphics driver from a pre-defined set of popular options.
(The template xorg is for beginner users, not advanced, and should (The template xorg is for beginner users, not advanced, and should

View File

@ -17,9 +17,9 @@ class LocaleMenu(AbstractSubMenu[LocaleConfiguration]):
locale_conf: LocaleConfiguration, locale_conf: LocaleConfiguration,
): ):
self._locale_conf = locale_conf self._locale_conf = locale_conf
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, sort_items=False, checkmarks=True) self._item_group = MenuItemGroup(menu_options, sort_items=False, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,
config=self._locale_conf, config=self._locale_conf,

View File

@ -141,6 +141,6 @@ class ListManager[ValueT]:
def filter_options(self, selection: ValueT, options: list[str]) -> list[str]: def filter_options(self, selection: ValueT, options: list[str]) -> list[str]:
""" """
filter which actions to show for an specific selection filter which actions to show for a specific selection
""" """
return options return options

View File

@ -217,8 +217,8 @@ class MirrorMenu(AbstractSubMenu[MirrorConfiguration]):
else: else:
self._mirror_config = MirrorConfiguration() self._mirror_config = MirrorConfiguration()
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, checkmarks=True) self._item_group = MenuItemGroup(menu_options, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -82,7 +82,7 @@ class MirrorStatusEntryV3(BaseModel):
@property @property
def latency(self) -> float | None: def latency(self) -> float | None:
""" """
Latency measures the miliseconds between one ICMP request & response. Latency measures the milliseconds between one ICMP request & response.
It only does so once because we check if self._latency is None, and a ICMP timeout result in -1 It only does so once because we check if self._latency is None, and a ICMP timeout result in -1
We do this because some hosts blocks ICMP so we'll have to rely on .speed() instead which is slower. We do this because some hosts blocks ICMP so we'll have to rely on .speed() instead which is slower.
""" """

View File

@ -95,7 +95,7 @@ def find_packages(*names: str) -> dict[str, PackageSearchResult]:
def validate_package_list(packages: list[str]) -> tuple[list[str], list[str]]: def validate_package_list(packages: list[str]) -> tuple[list[str], list[str]]:
""" """
Validates a list of given packages. Validates a list of given packages.
return: Tuple of lists containing valid packavges in the first and invalid return: Tuple of lists containing valid packages in the first and invalid
packages in the second entry packages in the second entry
""" """
valid_packages = {package for package in packages if find_package(package)} valid_packages = {package for package in packages if find_package(package)}

View File

@ -25,8 +25,8 @@ class ProfileMenu(AbstractSubMenu[ProfileConfiguration]):
else: else:
self._profile_config = ProfileConfiguration() self._profile_config = ProfileConfiguration()
menu_optioons = self._define_menu_options() menu_options = self._define_menu_options()
self._item_group = MenuItemGroup(menu_optioons, checkmarks=True) self._item_group = MenuItemGroup(menu_options, checkmarks=True)
super().__init__( super().__init__(
self._item_group, self._item_group,

View File

@ -147,8 +147,8 @@ def perform_installation(mountpoint: Path) -> None:
# If the user provided a list of services to be enabled, pass the list to the enable_service function. # If the user provided a list of services to be enabled, pass the list to the enable_service function.
# Note that while it's called enable_service, it can actually take a list of services and iterate it. # Note that while it's called enable_service, it can actually take a list of services and iterate it.
if servies := config.services: if services := config.services:
installation.enable_service(servies) installation.enable_service(services)
if disk_config.has_default_btrfs_vols(): if disk_config.has_default_btrfs_vols():
btrfs_options = disk_config.btrfs_options btrfs_options = disk_config.btrfs_options

View File

@ -29,7 +29,7 @@ def perform_installation(mountpoint: Path) -> None:
disk_config, disk_config,
kernels=config.kernels, kernels=config.kernels,
) as installation: ) as installation:
# Strap in the base system, add a boot loader and configure # Strap in the base system, add a bootloader and configure
# some other minor details as specified by this profile and user. # some other minor details as specified by this profile and user.
installation.mount_ordered_layout() installation.mount_ordered_layout()
installation.minimal_installation() installation.minimal_installation()

View File

@ -395,7 +395,7 @@ class MenuItemsState:
self._prev_visible_rows: list[int] = [] self._prev_visible_rows: list[int] = []
self._view_items: list[list[MenuItem]] = [] self._view_items: list[list[MenuItem]] = []
def _determine_foucs_row(self) -> int | None: def _determine_focus_row(self) -> int | None:
focus_index = self._item_group.index_focus() focus_index = self._item_group.index_focus()
if focus_index is None: if focus_index is None:
@ -406,7 +406,7 @@ class MenuItemsState:
def get_view_items(self) -> list[list[MenuItem]]: def get_view_items(self) -> list[list[MenuItem]]:
enabled_items = self._item_group.get_enabled_items() enabled_items = self._item_group.get_enabled_items()
focus_row_idx = self._determine_foucs_row() focus_row_idx = self._determine_focus_row()
if focus_row_idx is None: if focus_row_idx is None:
return [] return []

View File

@ -15,7 +15,7 @@ When submitting a help ticket, please include the :code:`/var/log/archinstall/in
It can be found both on the live ISO but also in the installed filesystem if the base packages were strapped in. It can be found both on the live ISO but also in the installed filesystem if the base packages were strapped in.
.. tip:: .. tip::
| An easy way to submit logs is ``curl -F'file=@/var/log/archinstall/install.log' https://0x0.st``. | An easy way to submit logs is ``curl -F 'file=@/var/log/archinstall/install.log' https://0x0.st``.
| Use caution when submitting other log files, but ``archinstall`` pledges to keep ``install.log`` safe for posting publicly! | Use caution when submitting other log files, but ``archinstall`` pledges to keep ``install.log`` safe for posting publicly!
There are additional log files under ``/var/log/archinstall/`` that can be useful: There are additional log files under ``/var/log/archinstall/`` that can be useful:

View File

@ -7,7 +7,7 @@ from archinstall.tui import Tui
for _profile in profile_handler.get_mac_addr_profiles(): for _profile in profile_handler.get_mac_addr_profiles():
# Tailored means it's a match for this machine # Tailored means it's a match for this machine
# based on it's MAC address (or some other criteria # based on its MAC address (or some other criteria
# that fits the requirements for this machine specifically). # that fits the requirements for this machine specifically).
info(f'Found a tailored profile for this machine called: "{_profile.name}"') info(f'Found a tailored profile for this machine called: "{_profile.name}"')