Skip to content

Commit

Permalink
Enable the unused-variable pylint rule and fix warnings (archlinux#2978)
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost authored and castillofrancodamian committed Dec 21, 2024
1 parent f3035e6 commit ed6de65
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion archinstall/lib/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def poll(self) -> None:

if self.child_fd:
got_output = False
for fileno, event in self.poll_object.poll(0.1):
for _fileno, _event in self.poll_object.poll(0.1):
try:
output = os.read(self.child_fd, 8192)
got_output = True
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/interactions/general_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def validator(value: str) -> str | None:
# Verify packages that were given
out = str(_("Verifying that additional packages exist (this might take a few seconds)"))
Tui.print(out, 0)
valid, invalid = validate_package_list(packages)
_valid, invalid = validate_package_list(packages)

if invalid:
return f'{_("Some packages could not be found in the repository")}: {invalid}'
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_hw_addr(ifname: str) -> str:
def list_interfaces(skip_loopback: bool = True) -> dict[str, str]:
interfaces = {}

for index, iface in socket.if_nameindex():
for _index, iface in socket.if_nameindex():
if skip_loopback and iface == "lo":
continue

Expand Down Expand Up @@ -183,7 +183,7 @@ def ping(hostname, timeout=5) -> int:
# for a ICMP response or exit with no latency
while latency == -1 and time.time() - started < timeout:
try:
for fileno, event in watchdog.poll(0.1):
for _fileno, _event in watchdog.poll(0.1):
response, _ = icmp_socket.recvfrom(1024)
icmp_type = struct.unpack('!B', response[20:21])[0]

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/profile/profiles_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _load_profile_class(self, module: ModuleType) -> list[Profile]:
Load all default_profiles defined in a module
"""
profiles = []
for k, v in module.__dict__.items():
for v in module.__dict__.values():
if isinstance(v, type) and v.__module__ == module.__name__:
bases = inspect.getmro(v)

Expand Down
2 changes: 1 addition & 1 deletion archinstall/tui/curses_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def _assemble_menu_cells(self) -> list[MenuCell]:
items = self._get_visible_items()
entries = []

for row_idx, item in enumerate(items):
for item in items:
item_text = ''

if self._multi and not item.is_empty():
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ disable = [
"unreachable",
"unspecified-encoding",
"unused-argument",
"unused-variable",
]

[tool.pylint.refactoring]
Expand Down

0 comments on commit ed6de65

Please sign in to comment.