Skip to content

Build failing on PR #37: ruff format check fails on Documentation/event-sources.md #38

Description

@cratis-direct

What's wrong

The "Build" workflow is failing on PR #37 (feature/registered-event-sources), run
https://github.com/Cratis/Chronicle.Python/actions/runs/37098674267 — the "Check formatting"
step (ruff format --check .) fails because the Python code block in
Documentation/event-sources.md has an unwrapped import statement and an
EventStreamDefinition(...) call that exceed the project's 120-character line length
([tool.ruff] line-length = 120) and are not formatted per ruff's style.

Reproduced locally against feature/registered-event-sources (078435676d3359e252eaeb6c32eb6061f6b860db)
with ruff 0.16.10:

unformatted: File would be reformatted
  --> Documentation/event-sources.md:12:27

The fix

Running ruff format Documentation/event-sources.md produces this diff, after which
ruff format --check . (190 files), ruff check ., mypy src, and pytest (14 passed)
all pass clean on that branch:

diff --git a/Documentation/event-sources.md b/Documentation/event-sources.md
index a177a46..8b18b03 100644
--- a/Documentation/event-sources.md
+++ b/Documentation/event-sources.md
@@ -9,13 +9,20 @@ Routing belongs to the append, not to event types.
 
 ```python
 from cratis_chronicle.event_sources import (
-    ConcurrencyDimensions, EventSourceDefinition, EventStreamDefinition, resolve_routing,
+    ConcurrencyDimensions,
+    EventSourceDefinition,
+    EventStreamDefinition,
+    resolve_routing,
 )
 
 account = EventSourceDefinition(
     "Account",
     concurrency=ConcurrencyDimensions.EVENT_SOURCE_ID,
-    streams=(EventStreamDefinition("Transactions", concurrency=ConcurrencyDimensions.EVENT_SOURCE_ID | ConcurrencyDimensions.EVENT_STREAM_ID),),
+    streams=(
+        EventStreamDefinition(
+            "Transactions", concurrency=ConcurrencyDimensions.EVENT_SOURCE_ID | ConcurrencyDimensions.EVENT_STREAM_ID
+        ),
+    ),
 )
 routing = resolve_routing({account.name: account}, "Account", "Transactions")

Why this is an issue and not a PR/push

The fix is a single-file, mechanical ruff format run with no semantic change, verified
against the feature/registered-event-sources branch. This session's git/GitHub write
permissions (git push, gh pr) are gated behind manual approval that wasn't available
here, so I could not push the fix commit to the PR branch or open a pull request. @einari —
feel free to run ruff format Documentation/event-sources.md on your branch (or apply the
diff above) to unblock the Build workflow on #37.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions