Skip to content

Commit 372cf5b

Browse files
committed
Use bleeding-edge ruff/mypy, enforce ruff format, fix formatting on all files
1 parent b7ad086 commit 372cf5b

19 files changed

Lines changed: 48 additions & 8 deletions

.dmypy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"pid": 20917, "connection_name": "/var/folders/pr/r4bw9ms530v1y0b9_b0678m80000gn/T/tmphvhuxtfg/dmypy.sock"}

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
- name: Install dependencies
2525
run: uv sync --extra dev
2626

27+
- name: ruff format
28+
run: uv run ruff format --check .
29+
2730
- name: ruff check
2831
run: uv run ruff check .
2932

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Install dependencies
2323
run: uv sync --extra dev
2424

25+
- name: ruff format
26+
run: uv run ruff format --check .
27+
2528
- name: ruff check
2629
run: uv run ruff check .
2730

jqueue/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ async def write(content, if_match=None) -> str
5656
core/ — business logic (DirectQueue, BrokerQueue, GroupCommitLoop)
5757
adapters/ — concrete storage implementations
5858
"""
59+
5960
from __future__ import annotations
6061

6162
from jqueue.adapters.storage.filesystem import LocalFileSystemStorage

jqueue/adapters/storage/filesystem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2323
POSIX-only (Linux, macOS). Not compatible with NFS or distributed filesystems.
2424
"""
25+
2526
from __future__ import annotations
2627

2728
import asyncio

jqueue/adapters/storage/memory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Zero external dependencies. Safe for multiple concurrent coroutines in a
1212
single event loop. NOT safe across processes or threads.
1313
"""
14+
1415
from __future__ import annotations
1516

1617
import asyncio

jqueue/core/broker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
and dequeue call that arrives is buffered and committed in the *next* write —
2424
collapsing N concurrent writes down to O(1) storage round-trips.
2525
"""
26+
2627
from __future__ import annotations
2728

2829
import dataclasses

jqueue/core/codec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
]
2525
}
2626
"""
27+
2728
from __future__ import annotations
2829

2930
from jqueue.domain.models import QueueState

jqueue/core/direct.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
with linear back-off (10ms × attempt). Raises CASConflictError if all retries
1616
are exhausted.
1717
"""
18+
1819
from __future__ import annotations
1920

2021
import asyncio
@@ -111,9 +112,7 @@ def _fn(state: QueueState) -> QueueState:
111112
job = state.find(job_id)
112113
if job is None:
113114
raise JobNotFoundError(job_id)
114-
return state.with_job_replaced(
115-
job.with_heartbeat(datetime.now(UTC))
116-
)
115+
return state.with_job_replaced(job.with_heartbeat(datetime.now(UTC)))
117116

118117
await self._mutate(_fn)
119118

jqueue/core/group_commit.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
If one mutation in a batch raises (e.g., JobNotFoundError), that future gets
2424
the exception but the other mutations in the batch still commit normally.
2525
"""
26+
2627
from __future__ import annotations
2728

2829
import asyncio
@@ -168,9 +169,7 @@ def _fn(state: QueueState) -> QueueState:
168169
job = state.find(job_id)
169170
if job is None:
170171
raise JobNotFoundError(job_id)
171-
return state.with_job_replaced(
172-
job.with_heartbeat(datetime.now(UTC))
173-
)
172+
return state.with_job_replaced(job.with_heartbeat(datetime.now(UTC)))
174173

175174
await self._submit(_fn)
176175

0 commit comments

Comments
 (0)