Chore: Enable ruff FBT (#8645)

This commit is contained in:
Sebastian Steinbeißer
2025-02-07 18:12:03 +01:00
committed by GitHub
parent b274665e21
commit e560fa3be0
27 changed files with 133 additions and 65 deletions

View File

@@ -10,7 +10,7 @@ if TYPE_CHECKING:
class BulkArchiveStrategy:
def __init__(self, zipf: ZipFile, follow_formatting: bool = False) -> None:
def __init__(self, zipf: ZipFile, *, follow_formatting: bool = False) -> None:
self.zipf: ZipFile = zipf
if follow_formatting:
self.make_unique_filename: Callable[..., Path | str] = (
@@ -22,6 +22,7 @@ class BulkArchiveStrategy:
def _filename_only(
self,
doc: Document,
*,
archive: bool = False,
folder: str = "",
) -> str:
@@ -33,7 +34,10 @@ class BulkArchiveStrategy:
"""
counter = 0
while True:
filename: str = folder + doc.get_public_filename(archive, counter)
filename: str = folder + doc.get_public_filename(
archive=archive,
counter=counter,
)
if filename in self.zipf.namelist():
counter += 1
else:
@@ -42,6 +46,7 @@ class BulkArchiveStrategy:
def _formatted_filepath(
self,
doc: Document,
*,
archive: bool = False,
folder: str = "",
) -> Path: