ruff: enable PTH lint

This commit is contained in:
Marcel Hellwig
2026-01-05 13:19:25 +01:00
parent acd883df21
commit 805a6981a6
2 changed files with 4 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ from media_manager.torrent.schemas import Torrent
log = logging.getLogger(__name__)
def list_files_recursively(path: Path = Path(".")) -> list[Path]:
def list_files_recursively(path: Path = Path()) -> list[Path]:
files = list(path.glob("**/*"))
log.debug(f"Found {len(files)} entries via glob")
valid_files = []
@@ -158,8 +158,7 @@ def get_torrent_hash(torrent: IndexerQueryResult) -> str:
raise
# saving the torrent file
with open(torrent_filepath, "wb") as file:
file.write(torrent_content)
torrent_filepath.write_bytes(torrent_content)
# parsing info hash
log.debug(f"parsing torrent file: {torrent.download_url}")

View File

@@ -5,7 +5,7 @@ line-ending = "lf"
quote-style = "double"
[lint]
# to be enabled: ANN, BLE, C90, CPY, D, DOC, DTZ, FBT, G, PL, PTH, RET, RSE, SLF, SIM, TC, TRY, UP
# to be enabled: ANN, BLE, C90, CPY, D, DOC, DTZ, FBT, G, PL, RET, RSE, SLF, SIM, TC, TRY, UP
extend-select = [
"A", "ARG", "ASYNC",
"B",
@@ -16,7 +16,7 @@ extend-select = [
"I", "ICN", "INP", "INT", "ISC",
"LOG",
"N",
"PERF", "PGH", "PIE", "PT", "PYI",
"PERF", "PGH", "PIE", "PT", "PTH", "PYI",
"Q",
"RUF",
"S", "SLOT",