Enable bare-except linter rules and fix warnings (#2988)
This commit is contained in:
parent
0bc2ad700f
commit
60842bd1cf
3
.flake8
3
.flake8
|
|
@ -1,7 +1,6 @@
|
|||
[flake8]
|
||||
count = True
|
||||
# Several of the following could be autofixed or improved by running the code through psf/black
|
||||
ignore = E722,W191,W503
|
||||
ignore = W191,W503
|
||||
max-complexity = 40
|
||||
max-line-length = 160
|
||||
show-source = True
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
on: [ push, pull_request ]
|
||||
name: flake8 linting (3 ignores)
|
||||
name: flake8 linting
|
||||
jobs:
|
||||
flake8:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class SysCommandWorker:
|
|||
if self.child_fd:
|
||||
try:
|
||||
os.close(self.child_fd)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if self.peek_output:
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def get_kb_layout() -> str:
|
|||
"localectl --no-pager status",
|
||||
environment_vars={'SYSTEMD_COLORS': '0'}
|
||||
).decode().splitlines()
|
||||
except:
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
vcline = ""
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ def perform_installation(mountpoint: Path) -> None:
|
|||
if chroot:
|
||||
try:
|
||||
installation.drop_to_shell()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
debug(f"Disk states after installing:\n{disk.disk_layouts()}")
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode) -> None:
|
|||
if chroot:
|
||||
try:
|
||||
installation.drop_to_shell()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
debug(f"Disk states after installing:\n{disk.disk_layouts()}")
|
||||
|
|
|
|||
|
|
@ -794,7 +794,7 @@ class EditMenu(AbstractCurses):
|
|||
self._real_input += chr(key)
|
||||
if self._hide_input:
|
||||
key = 42
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return key
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ def perform_installation(mountpoint: Path) -> None:
|
|||
if chroot:
|
||||
try:
|
||||
installation.drop_to_shell()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
debug(f"Disk states after installing:\n{disk.disk_layouts()}")
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@ disable = [
|
|||
"C",
|
||||
"R",
|
||||
"attribute-defined-outside-init",
|
||||
"bare-except",
|
||||
"broad-exception-caught",
|
||||
"cell-var-from-loop",
|
||||
"dangerous-default-value",
|
||||
|
|
@ -204,7 +203,6 @@ select = [
|
|||
]
|
||||
|
||||
ignore = [
|
||||
"E722", # bare-except
|
||||
"PLC0415", # import-outside-top-level
|
||||
"PLC1901", # compare-to-empty-string
|
||||
"PLW1514", # unspecified-encoding
|
||||
|
|
|
|||
Loading…
Reference in New Issue