Skip to content

Commit c963d37

Browse files
committed
expand ruff rules
1 parent 089ef2d commit c963d37

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,20 @@ dev = [
3434

3535
# ruff configuration
3636
[tool.ruff]
37+
target-version = "py313"
3738
line-length = 120
3839

3940
[tool.ruff.lint]
40-
extend-select = ["E", "F", "I", "FAST", "ASYNC", "TRY", "PERF", "UP", "FURB", "A"]
41+
extend-select = ["E", "F", "I", "FAST", "ASYNC", "TRY", "PERF", "UP", "FURB", "A", "B", "S", "C4", "PIE", "RUF", "TC"]
42+
ignore = ["RUF022"]
43+
44+
[tool.ruff.lint.per-file-ignores]
45+
"src/tests/**/*.py" = ["S101"]
46+
"*/test_*.py" = ["S101"]
47+
48+
[tool.ruff.lint.flake8-type-checking]
49+
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
50+
runtime-evaluated-decorators = ["pydantic.validate_call"]
4151

4252
[tool.pytest.ini_options]
4353
pythonpath = ["src"]

src/bubble_data_api_client/pool.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async def close_clients() -> None:
9292
if not client.is_closed:
9393
try:
9494
await client.aclose()
95-
except Exception:
95+
except Exception: # noqa: S110
9696
pass # best-effort cleanup, continue with remaining clients
9797

9898

@@ -131,7 +131,7 @@ def _atexit_cleanup() -> None:
131131
try:
132132
future = asyncio.run_coroutine_threadsafe(client.aclose(), running_loop)
133133
future.result(timeout=5.0)
134-
except Exception:
134+
except Exception: # noqa: S110
135135
pass
136136
else:
137137
# no running loop, create one and close all clients
@@ -140,14 +140,14 @@ async def _close_all() -> None:
140140
if not client.is_closed:
141141
try:
142142
await client.aclose()
143-
except Exception:
143+
except Exception: # noqa: S110
144144
pass
145145

146146
try:
147147
asyncio.run(_close_all())
148-
except Exception:
148+
except Exception: # noqa: S110
149149
pass
150-
except Exception:
150+
except Exception: # noqa: S110
151151
pass
152152

153153

src/tests/unit/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_is_bubble_uid_non_string(value: object, reason: str) -> None:
5858
("+123x456", "plus sign first part"),
5959
("123.0x456", "decimal in first part"),
6060
("123x456.0", "decimal in second part"),
61-
("١٢٣x٤٥٦", "arabic-indic digits"),
61+
("١٢٣x٤٥٦", "arabic-indic digits"), # noqa: RUF001
6262
("१२३x४५६", "devanagari digits"),
6363
],
6464
)

0 commit comments

Comments
 (0)