Enable most flake8-bugbear rules in ruff (#3110)
This commit is contained in:
parent
4212357c6f
commit
457e790bd0
|
|
@ -1159,7 +1159,7 @@ class Installer:
|
|||
config = grub_default.read_text()
|
||||
|
||||
kernel_parameters = ' '.join(self._get_kernel_params(root, False, False))
|
||||
config = re.sub(r'(GRUB_CMDLINE_LINUX=")("\n)', rf'\1{kernel_parameters}\2', config, 1)
|
||||
config = re.sub(r'(GRUB_CMDLINE_LINUX=")("\n)', rf'\1{kernel_parameters}\2', config, count=1)
|
||||
|
||||
grub_default.write_text(config)
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class MirrorStatusEntryV3(BaseModel):
|
|||
self._speed = size / timer.time
|
||||
debug(f" speed: {self._speed} ({int(self._speed / 1024 / 1024 * 100) / 100}MiB/s)")
|
||||
# Do not retry error
|
||||
except (urllib.error.URLError, ) as error:
|
||||
except urllib.error.URLError as error:
|
||||
debug(f" speed: <undetermined> ({error}), skip")
|
||||
self._speed = 0
|
||||
# Do retry error
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ class AbstractCurses(metaclass=ABCMeta):
|
|||
full_header = []
|
||||
|
||||
if header:
|
||||
for header in header.split('\n'):
|
||||
full_header += [ViewportEntry(header, cur_row, offset, STYLE.NORMAL)]
|
||||
for line in header.split('\n'):
|
||||
full_header += [ViewportEntry(line, cur_row, offset, STYLE.NORMAL)]
|
||||
cur_row += 1
|
||||
|
||||
return full_header
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ line-length = 160
|
|||
[tool.ruff.lint]
|
||||
select = [
|
||||
"ASYNC", # flake8-async
|
||||
"B", # flake8-bugbear
|
||||
"C90", # mccabe
|
||||
"DTZ", # flake8-datetimez
|
||||
"E", # pycodestyle errors
|
||||
|
|
@ -206,6 +207,12 @@ select = [
|
|||
]
|
||||
|
||||
ignore = [
|
||||
"B005", # strip-with-multi-characters
|
||||
"B006", # mutable-argument-default
|
||||
"B008", # function-call-in-default-argument
|
||||
"B010", # set-attr-with-constant
|
||||
"B904", # raise-without-from-inside-except
|
||||
"B905", # zip-without-explicit-strict
|
||||
"PLC0415", # import-outside-top-level
|
||||
"PLC1901", # compare-to-empty-string
|
||||
"PLW1514", # unspecified-encoding
|
||||
|
|
|
|||
Loading…
Reference in New Issue