diff --git a/archinstall/lib/authentication/authentication_menu.py b/archinstall/lib/authentication/authentication_menu.py index b5edc0b06f..0b90487a9a 100644 --- a/archinstall/lib/authentication/authentication_menu.py +++ b/archinstall/lib/authentication/authentication_menu.py @@ -37,7 +37,7 @@ def _define_menu_options(self) -> list[MenuItem]: return [ MenuItem( text=tr('Root password'), - action=lambda x: select_root_password(), + action=lambda _: select_root_password(), preview_action=self._prev_root_pwd, key='root_enc_password', ), diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index 6bf4d4fc5e..d554730328 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -14,7 +14,7 @@ async def confirm_config(config: ArchConfig) -> bool: header += tr('Would you like to continue?') + '\n' group = MenuItemGroup.yes_no() - group.set_preview_for_all(lambda x: config.user_config_to_json()) + group.set_preview_for_all(lambda _: config.user_config_to_json()) result = await Confirmation( group=group, diff --git a/archinstall/lib/disk/encryption_menu.py b/archinstall/lib/disk/encryption_menu.py index 7691b8dfe2..a36c0cdcf4 100644 --- a/archinstall/lib/disk/encryption_menu.py +++ b/archinstall/lib/disk/encryption_menu.py @@ -58,7 +58,7 @@ def _define_menu_options(self) -> list[MenuItem]: ), MenuItem( text=tr('Encryption password'), - action=lambda x: select_encrypted_password(), + action=lambda _: select_encrypted_password(), value=self._enc_config.encryption_password, dependencies=[self._check_dep_enc_type], preview_action=self._prev_password, @@ -181,7 +181,7 @@ def _preview(self, item: MenuItem) -> str | None: return output - def _prev_type(self, item: MenuItem) -> str | None: + def _prev_type(self, _item: MenuItem) -> str | None: enc_type = self._item_group.find_by_key('encryption_type').value if enc_type: diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index 1460d3407e..87352786b4 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -177,7 +177,7 @@ def _get_menu_options(self) -> list[MenuItem]: ), MenuItem( text=tr('Save configuration'), - action=lambda x: self._safe_config(), + action=lambda _: self._safe_config(), key=SpecialMenuKey.SAVE.value, ), MenuItem( @@ -502,7 +502,7 @@ def _get_install_warnings(self) -> list[str]: return warnings - def _prev_install_invalid_config(self, item: MenuItem) -> PreviewResult | None: + def _prev_install_invalid_config(self, _item: MenuItem) -> PreviewResult | None: self.sync_all_to_config() warnings = self._get_install_warnings() diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index e110548f99..499f52ba1a 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -240,7 +240,6 @@ def _verify_boot_part(self) -> None: def sanity_check( self, - offline: bool = False, skip_ntp: bool = False, skip_wkd: bool = False, ) -> None: @@ -547,7 +546,7 @@ def add_swapfile(self, size: str = '4G', enable_resume: bool = True, file: str = self._kernel_params.append(f'resume=UUID={resume_uuid}') self._kernel_params.append(f'resume_offset={resume_offset}') - def post_install_check(self, *args: str, **kwargs: str) -> list[str]: + def post_install_check(self) -> list[str]: return [step for step, flag in self._helper_flags.items() if flag is False] def set_mirrors( diff --git a/archinstall/lib/menu/list_manager.py b/archinstall/lib/menu/list_manager.py index 9b0d9cfc74..a5223abd45 100644 --- a/archinstall/lib/menu/list_manager.py +++ b/archinstall/lib/menu/list_manager.py @@ -134,7 +134,7 @@ async def handle_action(self, action: str, entry: ValueT | None, data: list[Valu """ raise NotImplementedError('Please implement me in the child class') - 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 a specific selection """ diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index 16b128553d..6ceae95a12 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -37,7 +37,7 @@ def __init__(self, timeout: int = 5) -> None: self.previous_handler = None self.previous_timer: int | None = None - def raise_timeout(self, signl: int, frame: FrameType | None) -> None: + def raise_timeout(self, _signl: int, _frame: FrameType | None) -> None: """ Raise the DownloadTimeout exception. """ diff --git a/archinstall/lib/plugins.py b/archinstall/lib/plugins.py index 41b862f81e..4756e587c4 100644 --- a/archinstall/lib/plugins.py +++ b/archinstall/lib/plugins.py @@ -28,7 +28,7 @@ # @archinstall.plugin decorator hook to programmatically add # plugins in runtime. Useful in profiles_bck and other things. -def plugin(f: Any, *args: Any, **kwargs: Any) -> None: +def plugin(f: Any, *_args: Any, **_kwargs: Any) -> None: plugins[f.__name__] = f diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py index 627a3b7553..9e04d27e61 100644 --- a/archinstall/scripts/guided.py +++ b/archinstall/scripts/guided.py @@ -87,7 +87,6 @@ def perform_installation( installation.mount_ordered_layout() installation.sanity_check( - arch_config_handler.args.offline, arch_config_handler.args.skip_ntp, arch_config_handler.args.skip_wkd, ) diff --git a/archinstall/tui/components.py b/archinstall/tui/components.py index 75cb82bea5..ada1f5c30b 100644 --- a/archinstall/tui/components.py +++ b/archinstall/tui/components.py @@ -347,7 +347,7 @@ def _update_options(self, options: list[Option]) -> None: if focus_item := self._group.focus_item: self._set_preview(focus_item.get_id()) - def on_input_submitted(self, event: Input.Submitted) -> None: + def on_input_submitted(self, _event: Input.Submitted) -> None: if self.query_one(Input).has_focus: self._handle_search_action() @@ -557,7 +557,7 @@ def compose(self) -> ComposeResult: yield Footer() - def on_input_submitted(self, event: Input.Submitted) -> None: + def on_input_submitted(self, _event: Input.Submitted) -> None: if self.query_one(Input).has_focus: self._handle_search_action() diff --git a/archinstall/tui/menu_item.py b/archinstall/tui/menu_item.py index 98b57de070..401154bb77 100644 --- a/archinstall/tui/menu_item.py +++ b/archinstall/tui/menu_item.py @@ -292,7 +292,7 @@ def focus_last(self) -> None: if last_item is not None: self.focus_item = last_item - def focus_prev(self, skip_empty: bool = True) -> None: + def focus_prev(self) -> None: # e.g. when filter shows no items if self.focus_item is None: return @@ -302,7 +302,7 @@ def focus_prev(self, skip_empty: bool = True) -> None: if item is not None: self.focus_item = item - def focus_next(self, skip_not_enabled: bool = True) -> None: + def focus_next(self) -> None: # e.g. when filter shows no items if self.focus_item is None: return diff --git a/docs/conf.py b/docs/conf.py index 65f752438b..ab52ef9a4a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,11 +10,11 @@ def process_docstring( - app: Sphinx, - what: str, - name: str, - obj: Any, - options: Any, + _app: Sphinx, + _what: str, + _name: str, + _obj: Any, + _options: Any, lines: list[str], ) -> None: spaces_pat = re.compile(r'( {8})') diff --git a/pyproject.toml b/pyproject.toml index 64abe9aedf..995d4b368d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -183,6 +183,7 @@ docstring-code-format = true [tool.ruff.lint] select = [ "ANN", # flake8-annotations + "ARG", # flake8-unused-arguments "ASYNC", # flake8-async "B", # flake8-bugbear "C4", # flake8-comprehensions