Skip to content

Commit

Permalink
🔧 Go all in with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Dec 3, 2024
1 parent 7c19a57 commit 29809c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 62 deletions.
2 changes: 0 additions & 2 deletions cookbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ format:
requires:
- install
commands:
- black .
- ruff check --fix-only .

lint:
phony: true
requires:
- install
commands:
- black --check .
- p check --lockfile
- ruff check .
- mypy .
Expand Down
61 changes: 4 additions & 57 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dev = [
"ipython~=8.18",
]
lint = [
"black~=24.10",
"mypy~=1.13",
"ruff~=0.8",
"types-requests~=2.0",
Expand All @@ -62,11 +61,6 @@ docs = [
"pymdown-extensions~=10.12",
]

[tool.black]
target-version = [
"py39",
]

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
Expand Down Expand Up @@ -94,61 +88,14 @@ target-version = "py39"

[tool.ruff.lint]
select = [
"A",
"ANN",
"ARG",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DTZ",
"E",
"EM",
"ERA",
"EXE",
"F",
"FA",
"FBT",
"FIX",
"FLY",
"FURB",
"G",
"I",
"ICN",
"INP",
"ISC",
"LOG",
"N",
"PGH",
"PERF",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"SLOT",
"T10",
"TCH",
"TD",
"TID",
"TRY",
"UP",
"W",
"YTT",
"ALL",
]
ignore = [
"ANN101",
"ANN102",
"ANN401",
"COM812",
"D10",
"D203",
"D213",
"E501",
"FIX002",
"PLR09",
Expand Down
6 changes: 3 additions & 3 deletions src/tvdb_api_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _get(self, url: URL) -> dict[str, Any]:
def get_raw_series_by_id(
self, tvdb_id: int, *, refresh_cache: bool = False
) -> dict[str, Any]:
"""Get the series info by its tvdb ib as returned by the TVDB"""
"""Get the series info by its tvdb ib as returned by the TVDB."""
key = f"get_series_by_id::tvdb_id:{tvdb_id}"
data: dict[str, Any] | None = self._cache.get(key)
if data is None or refresh_cache:
Expand All @@ -109,7 +109,7 @@ def get_series_by_id(self, tvdb_id: int, *, refresh_cache: bool = False) -> Seri
def get_raw_episodes_by_series(
self, tvdb_id: int, season_type: str = "default", *, refresh_cache: bool = False
) -> list[dict[str, Any]]:
"""Get all the episodes for a TV series as returned by the TVDB"""
"""Get all the episodes for a TV series as returned by the TVDB."""
key = f"get_episodes_by_series::tvdb_id:{tvdb_id}"
data: list[dict[str, Any]] | None = self._cache.get(key)
if data is None or refresh_cache:
Expand All @@ -122,7 +122,7 @@ def get_raw_episodes_by_series(
def get_episodes_by_series(
self, tvdb_id: int, season_type: str = "default", *, refresh_cache: bool = False
) -> list[Episode]:
"""Get all the episodes for a TV series"""
"""Get all the episodes for a TV series."""
raw_data = self.get_raw_episodes_by_series(
tvdb_id, season_type, refresh_cache=refresh_cache
)
Expand Down

0 comments on commit 29809c7

Please sign in to comment.