Enable the redefined-outer-name pylint rule and fix warnings (#2964)
This commit is contained in:
parent
544400606f
commit
d4c04a83a3
|
|
@ -264,16 +264,16 @@ def load_config() -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def post_process_arguments(arguments: dict[str, Any]) -> None:
|
def post_process_arguments(args: dict[str, Any]) -> None:
|
||||||
storage['arguments'] = arguments
|
storage['arguments'] = args
|
||||||
if mountpoint := arguments.get('mount_point', None):
|
if mountpoint := args.get('mount_point', None):
|
||||||
storage['MOUNT_POINT'] = Path(mountpoint)
|
storage['MOUNT_POINT'] = Path(mountpoint)
|
||||||
|
|
||||||
if arguments.get('debug', False):
|
if args.get('debug', False):
|
||||||
warn(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!")
|
warn(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!")
|
||||||
|
|
||||||
if arguments.get('plugin', None):
|
if args.get('plugin', None):
|
||||||
path = arguments['plugin']
|
path = args['plugin']
|
||||||
load_plugin(path)
|
load_plugin(path)
|
||||||
|
|
||||||
load_config()
|
load_config()
|
||||||
|
|
|
||||||
|
|
@ -430,7 +430,7 @@ class _PartitionInfo:
|
||||||
fs_type: FilesystemType | None,
|
fs_type: FilesystemType | None,
|
||||||
partn: int | None,
|
partn: int | None,
|
||||||
partuuid: str | None,
|
partuuid: str | None,
|
||||||
uuid: str | None,
|
uuid: str | None, # pylint: disable=redefined-outer-name
|
||||||
mountpoints: list[Path],
|
mountpoints: list[Path],
|
||||||
btrfs_subvol_infos: list[_BtrfsSubvolumeInfo] = []
|
btrfs_subvol_infos: list[_BtrfsSubvolumeInfo] = []
|
||||||
) -> _PartitionInfo:
|
) -> _PartitionInfo:
|
||||||
|
|
|
||||||
|
|
@ -732,9 +732,9 @@ class Installer:
|
||||||
try:
|
try:
|
||||||
SysCommand(f'/usr/bin/arch-chroot {self.target} mkinitcpio {" ".join(flags)}', peek_output=True)
|
SysCommand(f'/usr/bin/arch-chroot {self.target} mkinitcpio {" ".join(flags)}', peek_output=True)
|
||||||
return True
|
return True
|
||||||
except SysCallError as error:
|
except SysCallError as e:
|
||||||
if error.worker:
|
if e.worker:
|
||||||
log(error.worker._trace_log.decode())
|
log(e.worker._trace_log.decode())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _get_microcode(self) -> Path | None:
|
def _get_microcode(self) -> Path | None:
|
||||||
|
|
|
||||||
|
|
@ -191,8 +191,8 @@ def ping(hostname, timeout=5) -> int:
|
||||||
if icmp_type == 0 and response[-len(random_identifier):] == random_identifier:
|
if icmp_type == 0 and response[-len(random_identifier):] == random_identifier:
|
||||||
latency = round((time.time() - started) * 1000)
|
latency = round((time.time() - started) * 1000)
|
||||||
break
|
break
|
||||||
except OSError as error:
|
except OSError as e:
|
||||||
debug(f"Error: {error}")
|
debug(f"Error: {e}")
|
||||||
break
|
break
|
||||||
|
|
||||||
icmp_socket.close()
|
icmp_socket.close()
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,6 @@ disable = [
|
||||||
"protected-access",
|
"protected-access",
|
||||||
"raise-missing-from",
|
"raise-missing-from",
|
||||||
"redefined-builtin",
|
"redefined-builtin",
|
||||||
"redefined-outer-name",
|
|
||||||
"unnecessary-lambda",
|
"unnecessary-lambda",
|
||||||
"unreachable",
|
"unreachable",
|
||||||
"unspecified-encoding",
|
"unspecified-encoding",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue