Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable arguments-renamed Pylint rule and fix warnings #2842

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions archinstall/lib/disk/partitioning_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def __init__(self, prompt: str, device: BDevice, device_partitions: list[Partiti
display_actions = list(self._actions.values())
super().__init__(prompt, device_partitions, display_actions[:2], display_actions[3:])

def selected_action_display(self, partition: PartitionModification) -> str:
if partition.status == ModificationStatus.Create:
def selected_action_display(self, selection: PartitionModification) -> str:
if selection.status == ModificationStatus.Create:
return str(_('Partition - New'))
else:
return str(partition.dev_path)
return str(selection.dev_path)

def filter_options(self, selection: PartitionModification, options: list[str]) -> list[str]:
not_filter = []
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/disk/subvolume_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def __init__(self, prompt: str, btrfs_subvols: list[SubvolumeModification]):
]
super().__init__(prompt, btrfs_subvols, [self._actions[0]], self._actions[1:])

def selected_action_display(self, subvolume: SubvolumeModification) -> str:
return str(subvolume.name)
def selected_action_display(self, selection: SubvolumeModification) -> str:
return str(selection.name)

def _add_subvolume(self, preset: SubvolumeModification | None = None) -> SubvolumeModification | None:
result = EditMenu(
Expand Down
8 changes: 4 additions & 4 deletions archinstall/lib/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ class JSON(json.JSONEncoder, json.JSONDecoder):
A safe JSON encoder that will omit private information in dicts (starting with !)
"""

def encode(self, obj: Any) -> str:
return super().encode(jsonify(obj))
def encode(self, o: Any) -> str:
return super().encode(jsonify(o))


class UNSAFE_JSON(json.JSONEncoder, json.JSONDecoder):
"""
UNSAFE_JSON will call/encode and keep private information in dicts (starting with !)
"""

def encode(self, obj: Any) -> str:
return super().encode(jsonify(obj, safe=False))
def encode(self, o: Any) -> str:
return super().encode(jsonify(o, safe=False))


class SysCommandWorker:
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/interactions/manage_users_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(self, prompt: str, lusers: list[User]):
]
super().__init__(prompt, lusers, [self._actions[0]], self._actions[1:])

def selected_action_display(self, user: User) -> str:
return user.username
def selected_action_display(self, selection: User) -> str:
return selection.username

def handle_action(self, action: str, entry: User | None, data: list[User]) -> list[User]:
if action == self._actions[0]: # add
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/interactions/network_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def __init__(self, prompt: str, preset: list[Nic]):
]
super().__init__(prompt, preset, [self._actions[0]], self._actions[1:])

def selected_action_display(self, nic: Nic) -> str:
return nic.iface if nic.iface else ''
def selected_action_display(self, selection: Nic) -> str:
return selection.iface if selection.iface else ''

def handle_action(self, action: str, entry: Nic | None, data: list[Nic]) -> list[Nic]:
if action == self._actions[0]: # add
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def __init__(self, custom_mirrors: list[CustomMirror]):
self._actions[1:]
)

def selected_action_display(self, mirror: CustomMirror) -> str:
return mirror.name
def selected_action_display(self, selection: CustomMirror) -> str:
return selection.name

def handle_action(
self,
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ max-line-length = 220
disable = [
"C",
"R",
"arguments-renamed",
"attribute-defined-outside-init",
"bad-indentation",
"bare-except",
Expand Down