Enable most flake8-pyi rules in ruff and fix a warning (#3248)
This commit is contained in:
parent
e46aa7c1b0
commit
269e6f8e54
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any, Self
|
||||||
|
|
||||||
from archinstall.tui.curses_menu import SelectMenu, Tui
|
from archinstall.tui.curses_menu import SelectMenu, Tui
|
||||||
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
|
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
|
||||||
|
|
@ -37,7 +37,7 @@ class AbstractMenu:
|
||||||
|
|
||||||
self._sync_from_config()
|
self._sync_from_config()
|
||||||
|
|
||||||
def __enter__(self, *args: Any, **kwargs: Any) -> AbstractMenu:
|
def __enter__(self, *args: Any, **kwargs: Any) -> Self:
|
||||||
self.is_context_mgr = True
|
self.is_context_mgr = True
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@ select = [
|
||||||
"PLC", # Pylint conventions
|
"PLC", # Pylint conventions
|
||||||
"PLE", # Pylint errors
|
"PLE", # Pylint errors
|
||||||
"PLW", # Pylint warnings
|
"PLW", # Pylint warnings
|
||||||
|
"PYI", # flake8-pyi
|
||||||
"RSE", # flake8-raise
|
"RSE", # flake8-raise
|
||||||
"RUF", # Ruff-specific rules
|
"RUF", # Ruff-specific rules
|
||||||
"SLOT", # flake8-slot
|
"SLOT", # flake8-slot
|
||||||
|
|
@ -219,6 +220,7 @@ ignore = [
|
||||||
"PLW1514", # unspecified-encoding
|
"PLW1514", # unspecified-encoding
|
||||||
"PLW1641", # eq-without-hash
|
"PLW1641", # eq-without-hash
|
||||||
"PLW2901", # redefined-loop-name
|
"PLW2901", # redefined-loop-name
|
||||||
|
"PYI036", # bad-exit-annotation
|
||||||
"RUF005", # collection-literal-concatenation
|
"RUF005", # collection-literal-concatenation
|
||||||
"RUF015", # unnecessary-iterable-allocation-for-first-element
|
"RUF015", # unnecessary-iterable-allocation-for-first-element
|
||||||
"RUF039", # unraw-re-pattern
|
"RUF039", # unraw-re-pattern
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue