Configure Ruff and lint everything

This commit is contained in:
2025-05-21 13:54:29 +02:00
parent 963adf4c77
commit 839d0e35ae
7 changed files with 38 additions and 20 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
from collections.abc import Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Self
from dataclasses import dataclass
from collections.abc import Sequence
from tqdm import tqdm
from karaokatalog.Song import Song
+2 -3
View File
@@ -1,10 +1,9 @@
from __future__ import annotations
import filecmp
from dataclasses import dataclass
from pathlib import Path
from typing import Self
import filecmp
from dataclasses import dataclass
type Title = str
type Artist = str
+11 -8
View File
@@ -1,14 +1,15 @@
from karaokatalog.Library import Library
from karaokatalog.Song import Song
import logging
import sys
from pathlib import Path
from tqdm import tqdm
from karaokatalog.deduplicate.find_duplicates import find_duplicates
from karaokatalog.deduplicate.prune import prune
from karaokatalog.Library import Library
from karaokatalog.Song import Song
from karaokatalog.util.get_equivalence_classes import get_equivalence_classes
from pathlib import Path
from tqdm import tqdm
import sys
import logging
logging.basicConfig(
format="%(asctime)s [%(levelname)s] %(message)s", level=logging.INFO
)
@@ -39,7 +40,9 @@ if __name__ == "__main__":
for equivalence_class in tqdm(exact_duplicates, unit=" exact duplicates")
for instruction in prune(equivalence_class)
)
logging.info(f"{len(pruning_instructions)} exactly duplicated songs will be deleted")
logging.info(
f"{len(pruning_instructions)} exactly duplicated songs will be deleted"
)
# TODO Call all pruning_instructions, to actually delete the files
+2 -2
View File
@@ -1,10 +1,10 @@
from collections.abc import Mapping, Sequence
from collections import defaultdict
from collections.abc import Mapping, Sequence
from tqdm import tqdm
from karaokatalog.Library import Library
from karaokatalog.Song import Song, Title, Artist
from karaokatalog.Song import Artist, Song, Title
type TitleAndArtist = tuple[Title, Artist]
@@ -1,6 +1,5 @@
from typing import Protocol
class Instruction(Protocol):
def __call__(self) -> None:
...
class Instruction(Protocol):
def __call__(self) -> None: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from collections.abc import Iterable, Sequence, Callable
from collections.abc import Callable, Iterable, Sequence
type EquivalenceClass[T] = Sequence[T]
+18
View File
@@ -0,0 +1,18 @@
[project]
requires-python = ">=3.12"
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# isort (for imports)
"I",
# pyupgrade (to upgrade to latest language syntax)
"UP",
# flake8-simplify
"SIM",
# flake8-use-pathlib
"PTH",
# mccabe
"C90",
]