Skip to content

Fix markdownlint issues in keyset pagination design doc#196

Open
leynos wants to merge 3 commits into
mainfrom
codex/run-make-fmt-and-fix-markdownlint-errors
Open

Fix markdownlint issues in keyset pagination design doc#196
leynos wants to merge 3 commits into
mainfrom
codex/run-make-fmt-and-fix-markdownlint-errors

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Oct 11, 2025

Summary

  • add an inline suppression for markdownlint line-length checks in the keyset pagination design document
  • clean up every fenced code block in the document to declare its language and remove stray copy/paste artefacts
  • update markdownlint configuration to ignore any .terraform directories so Terraform artifacts no longer trigger lint failures

Testing

  • make fmt
  • bun x markdownlint-cli2 docs/keyset-pagination-design.md

https://chatgpt.com/codex/tasks/task_e_68ea15c3cfc88322b9a5d6be7e019b0f

Summary by Sourcery

Fix markdownlint issues in the keyset pagination design document by adding an inline suppression for line-length linting, cleaning up code fences with language identifiers, and configuring the linter to ignore Terraform artifacts

Documentation:

  • Disable markdownlint MD013 in the keyset pagination design document
  • Annotate all fenced code blocks with explicit language identifiers and remove stray copy/paste artifacts

Chores:

  • Update markdownlint-cli2 configuration to ignore .terraform directories so Terraform artifacts no longer trigger lint failures

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Oct 11, 2025

Reviewer's Guide

This PR cleans up markdownlint violations in the keyset pagination design doc by disabling long-line checks inline, normalizing all fenced code blocks with proper language annotations and removing stray artifacts, and adjusts the markdownlint config to ignore Terraform directories.

File-Level Changes

Change Details Files
Disable line-length linting inline
  • Inserted an MD013 suppression comment at the top of the design document
docs/keyset-pagination-design.md
Normalize fenced code blocks
  • Declared explicit languages on all fences
  • Removed stray copy/paste markers and mismatched backticks
  • Standardized opening/closing fence syntax
docs/keyset-pagination-design.md
Ignore Terraform artifacts in linting
  • Added an ignore entry for **/.terraform directories in markdownlint-cli2.jsonc
.markdownlint-cli2.jsonc

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 11, 2025

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive keyset pagination design document, detailing cursor encoding/decoding, navigation (next/prev), pagination links, and a standard paginated response envelope.
    • Updated examples to illustrate constructing and consuming paginated responses.
  • Chores
    • Expanded markdown lint ignores to cover Terraform directories at any depth, reducing noise from generated files during linting.

Walkthrough

Add a global ignore pattern for any .terraform directories to the markdownlint config. Expand keyset pagination design with public Direction enum, cursor encode/decode, pagination wrappers and links, a UserCursorKey and conversion, and a PaginatedUsersResponse schema with updated examples.

Changes

Cohort / File(s) Summary
Lint config
./.markdownlint-cli2.jsonc
Add "**/.terraform/**" to ignores alongside existing .terraform/**.
Docs — keyset pagination API design
docs/keyset-pagination-design.md
Introduce public Direction enum; Cursor<K> type with base64url JSON encode/decode; PaginationLinks; Paginated<T: Serialize> envelope; UserCursorKey and From<&User> impl; PaginatedUsersResponse with utoipa::ToSchema; update examples to use new public API types.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as HTTP API
  participant Service as Pagination Service
  participant Repo as Repository

  Client->>API: GET /users?limit=...&cursor=...
  API->>Service: Cursor::decode(cursor)
  Service->>Repo: query with key boundary + direction
  Repo-->>Service: results (<= limit + 1)
  Service->>Service: determine next/prev cursors
  Service->>Service: Cursor::encode(new cursors)
  Service-->>API: Paginated<T> + PaginationLinks
  API-->>Client: 200 PaginatedUsersResponse
Loading
sequenceDiagram
  autonumber
  participant Client
  participant CursorOps as Cursor::encode/decode

  Client->>CursorOps: request encode(Cursor{dir, key})
  CursorOps->>CursorOps: serde JSON -> base64url
  CursorOps-->>Client: cursor string

  Client->>CursorOps: provide cursor string
  CursorOps->>CursorOps: base64url -> parse JSON
  CursorOps-->>Client: Cursor{dir, key}
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

New cursors spin with subtle grace,
Keys mark the path, a bounded trace.
Next and prev in tidy rows,
A base64 breeze softly blows.
Docs now chart the scrolling sea.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed State the title precisely summarises the primary change by highlighting fixing markdownlint issues in the keyset pagination design document and avoid unnecessary detail or noise.
Description Check ✅ Passed Outline the pull request description clearly to specify the markdownlint suppressions, code fence language annotations, and Terraform ignore configuration changes to ensure direct relevance to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/run-make-fmt-and-fix-markdownlint-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b5cd32 and df961ac.

📒 Files selected for processing (2)
  • .markdownlint-cli2.jsonc (1 hunks)
  • docs/keyset-pagination-design.md (16 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*.md

📄 CodeRabbit inference engine (docs/documentation-style-guide.md)

docs/**/*.md: Use British English based on the Oxford English Dictionary (en-oxendict) in documentation
The word “outwith” is acceptable in documentation
Use the Oxford comma
Treat company names as collective nouns (e.g., “Lille Industries are…”)
Write headings in sentence case
Use Markdown headings (#, ##, ###, …) in order without skipping levels
Follow markdownlint recommendations
Provide code blocks and lists using standard Markdown syntax
Always provide a language identifier for fenced code blocks; use plaintext for non-code text
Use '-' as the first-level bullet and renumber lists when items change
Prefer inline links using text or angle-bracketed URLs
Ensure blank lines before and after bulleted lists and fenced code blocks
Ensure tables have a delimiter line below the header row
Expand any uncommon acronym on first use (e.g., Continuous Integration (CI))
Wrap paragraphs at 80 columns
Wrap code at 120 columns (within documentation)
Do not wrap tables
Use footnotes referenced with [^label]
Include Mermaid diagrams where they add clarity
When embedding figures, use Markdown image syntax alt text and provide brief, descriptive alt text
Add a short description before each Mermaid diagram for screen readers

docs/**/*.md: Use docs/ as the source of truth for requirements, dependencies, and architectural decisions, and proactively update it when things change
Documentation in docs/ must use en-GB-oxendict spelling and grammar (LICENSE naming is exempt)
Keep TypeScript examples in docs small and compilable (typecheck during builds); mirror production patterns

Files:

  • docs/keyset-pagination-design.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

**/*.md: Validate Markdown with make markdownlint; wrap paragraphs/bullets at 80 columns, code blocks at 120, do not wrap tables/headings; use dashes for bullets and GFM footnotes
Run make fmt after documentation changes to format Markdown and fix table markup; validate Mermaid diagrams with make nixie

Files:

  • docs/keyset-pagination-design.md

⚙️ CodeRabbit configuration file

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -yse / -our) spelling and grammar
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/keyset-pagination-design.md
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (docs/contents.md)

Follow the Documentation style guide for all Markdown-based documentation

Files:

  • docs/keyset-pagination-design.md
🔍 Remote MCP Deepwiki, Ref

Additional Context for PR #196 Review

  1. Markdownlint Rule MD013 (Line Length)

    • Rule MD013 enforces a maximum line length.
    • To suppress MD013 inline, the syntax is:
      <!-- markdownlint-disable MD013 -->
      <!-- markdownlint-enable MD013 -->
    • This allows selectively ignoring long lines within a document.
  2. .markdownlint-cli2.jsonc Configuration

    • The PR adds:
      "ignores": [
        ".terraform/**",
        "**/.terraform/**"
      ]
    • This ensures that any .terraform directory at any depth is excluded from lint checks, preventing Terraform artifacts from causing errors.
  3. Fenced Code Block Language Declarations

    • Markdownlint recommends specifying a language for each code fence to enable proper linting and syntax highlighting.
    • The PR updates all fenced blocks in docs/keyset-pagination-design.md accordingly (e.g., rust, json).
  4. Impact on Keyset Pagination Doc

    • Inline MD013 suppression is scoped to the necessary sections, ensuring long example URLs or formatted code aren’t flagged while preserving line-length checks elsewhere.
    • All other lint rules remain enforced, improving doc consistency without altering content semantics.
⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Sourcery review
  • GitHub Check: build

Comment thread docs/keyset-pagination-design.md
Comment on lines 176 to 180

```
bashCopy code`"next": "/api/users?cursor=eyJkaXIiOiJOZXh0Iiwia2V5eyJjcmVhdGVkX2F0Ijoi2023...
`
```bash
"next": "/api/users?cursor=eyJkaXIiOiJOZXh0Iiwia2V5eyJjcmVhdGVkX2F0Ijoi2023...
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the fenced code block language.

Align the language tag with the snippet. The block shows a JSON fragment, not a Bash command, so keep markdownlint happy by switching to json (or plaintext). As per coding guidelines

-```bash
+```json
 "next": "/api/users?cursor=eyJkaXIiOiJOZXh0Iiwia2V5eyJjcmVhdGVkX2F0Ijoi2023...
 ```
🤖 Prompt for AI Agents
In docs/keyset-pagination-design.md around lines 176 to 180, the fenced code
block is labeled as bash but contains a JSON fragment; change the code fence
language tag from bash to json (or plaintext) so the block is correctly
highlighted and markdownlint-compliant.

Wrap the markdown to satisfy markdownlint MD013 without disabling the rule globally, and fix fenced code blocks to use JSON and text annotations where appropriate.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
docs/keyset-pagination-design.md (1)

297-299: Fix incorrect fence language for JSON fragment.

Label the snippet as JSON to satisfy markdownlint and improve readability. As per coding guidelines

-```bash
+```json
 "next": "/api/users?cursor=eyJkaXIiOiJOZXh0Iiwia2V5eyJjcmVhdGVkX2F0Ijoi2023...

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: ASSERTIVE

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between df961ac84149cae20c337729fbe3a1b44a6d2bbe and 1261b6ac91170b640734deb8d4d45ebe6eb77b3f.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/keyset-pagination-design.md` (9 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (3)</summary>

<details>
<summary>docs/**/*.md</summary>


**📄 CodeRabbit inference engine (docs/documentation-style-guide.md)**

> `docs/**/*.md`: Use British English based on the Oxford English Dictionary (en-oxendict) in documentation
> The word “outwith” is acceptable in documentation
> Use the Oxford comma
> Treat company names as collective nouns (e.g., “Lille Industries are…”)
> Write headings in sentence case
> Use Markdown headings (#, ##, ###, …) in order without skipping levels
> Follow markdownlint recommendations
> Provide code blocks and lists using standard Markdown syntax
> Always provide a language identifier for fenced code blocks; use plaintext for non-code text
> Use '-' as the first-level bullet and renumber lists when items change
> Prefer inline links using [text](url) or angle-bracketed URLs
> Ensure blank lines before and after bulleted lists and fenced code blocks
> Ensure tables have a delimiter line below the header row
> Expand any uncommon acronym on first use (e.g., Continuous Integration (CI))
> Wrap paragraphs at 80 columns
> Wrap code at 120 columns (within documentation)
> Do not wrap tables
> Use footnotes referenced with [^label]
> Include Mermaid diagrams where they add clarity
> When embedding figures, use Markdown image syntax ![alt text](path) and provide brief, descriptive alt text
> Add a short description before each Mermaid diagram for screen readers
> 
> `docs/**/*.md`: Use docs/ as the source of truth for requirements, dependencies, and architectural decisions, and proactively update it when things change
> Documentation in docs/ must use en-GB-oxendict spelling and grammar (LICENSE naming is exempt)
> Keep TypeScript examples in docs small and compilable (typecheck during builds); mirror production patterns

Files:
- `docs/keyset-pagination-design.md`

</details>
<details>
<summary>**/*.md</summary>


**📄 CodeRabbit inference engine (AGENTS.md)**

> `**/*.md`: Validate Markdown with make markdownlint; wrap paragraphs/bullets at 80 columns, code blocks at 120, do not wrap tables/headings; use dashes for bullets and GFM footnotes
> Run make fmt after documentation changes to format Markdown and fix table markup; validate Mermaid diagrams with make nixie

Files:
- `docs/keyset-pagination-design.md`

---

**⚙️ CodeRabbit configuration file**

> `**/*.md`: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")
> * Use en-GB-oxendict (-ize / -yse / -our) spelling and grammar
> * Headings must not be wrapped.
> * Documents must start with a level 1 heading
> * Headings must correctly increase or decrease by no more than one level at a time
> * Use GitHub-flavoured Markdown style for footnotes and endnotes.
> * Numbered footnotes must be numbered by order of appearance in the document.

Files:
- `docs/keyset-pagination-design.md`

</details>
<details>
<summary>docs/**/*.{md,mdx}</summary>


**📄 CodeRabbit inference engine (docs/contents.md)**

> Follow the Documentation style guide for all Markdown-based documentation

Files:
- `docs/keyset-pagination-design.md`

</details>

</details><details>
<summary>🔍 Remote MCP Ref</summary>

Summary of additional relevant facts for PR #196 review

- PR metadata: open PR #196 on leynos/wildside, branch codex/run-make-fmt-and-fix-markdownlint-errors → main; author leynos; created 2025-10-11T09:09:36Z.
- Markdownlint change: .markdownlint-cli2.jsonc adds ignores entries for ".terraform/**" and "**/.terraform/**" (intended to exclude Terraform directories at any depth). This prevents Terraform artifacts from triggering markdownlint failures.
- MD013 suppression: docs/keyset-pagination-design.md now contains inline markdownlint MD013 disable/enable comments to scope line-length rule suppression to required sections (so long example lines are exempt while line-length is still enforced elsewhere). Verify the disable/enable are correctly placed and only cover intended regions.
- Fenced code blocks: All fenced blocks in docs/keyset-pagination-design.md were annotated with explicit language identifiers (e.g., ```rust, ```json) and stray copy/paste artifacts were removed—confirm language tags are accurate for each block and that no content changed semantically.
- Testing steps listed in PR: run make fmt and bun x markdownlint-cli2 docs/keyset-pagination-design.md. Recommend running these locally to confirm no remaining lint failures.

Sources used
- PR page for leynos/wildside PR #196 (review and diff):

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 120000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)</summary>

* GitHub Check: build

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>docs/keyset-pagination-design.md (1)</summary><blockquote>

`3-4`: **Scope MD013 correctly; good.**

Keep the disable/enable paired and scoped. Verify it covers the intended long‑line section only.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

- **Opaque Cursors:** The cursor tokens will not expose internal IDs or SQL offsets. Instead, they will be **base64url-encoded JSON** strings that the server interprets([1](https://github.com/leynos/wildside/issues/52#L19-L24)). Clients should treat them as opaque.

- **No Total Counts:** We will **avoid returning total item counts** in the response([1](https://github.com/leynos/wildside/issues/52#L19-L24)) to prevent expensive `COUNT(*)` queries on large tables. Clients can detect the end of data by the absence of a `next` link.
## Overview and Goals
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Write headings in sentence case.

Lowercase non‑proper nouns. As per coding guidelines

-## Overview and Goals
+## Overview and goals
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Overview and Goals
## Overview and goals
🤖 Prompt for AI Agents
In docs/keyset-pagination-design.md around line 6, the heading "Overview and
Goals" uses title case; change it to sentence case by lowercasing non-proper
nouns so it reads "Overview and goals" to comply with the project's style
guidelines.

Comment on lines +122 to 124
```text
<base64-opaque-token>
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use 'plaintext' for non‑code fences.

Replace text with plaintext per docs style. As per coding guidelines

-```text
+```plaintext
 <base64-opaque-token>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In docs/keyset-pagination-design.md around lines 122 to 124 the fenced block
uses text which violates docs style; replace the fence language token from text to plaintext so the block reads plaintext, keep the inner content
unchanged and ensure closing fence stays ``` to follow the style guideline.


</details>

<!-- fingerprinting:phantom:triton:chinchilla -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +268 to +273
- **Object format:** e.g.
`{"dir":"Next","key":{"created_at":"2025-10-10T19:17:56Z","id":"<uuid>"}}`.
This is more verbose but self-describing and robust if we extend the key with
additional fields later. We favor this **object format** for clarity and
extensibility, at the cost of a slightly longer token.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Use en‑GB spelling.

Change “favor” → “favour”. As per coding guidelines

-  additional fields later. We favor this **object format** for clarity and
+  additional fields later. We favour this **object format** for clarity and
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Object format:** e.g.
`{"dir":"Next","key":{"created_at":"2025-10-10T19:17:56Z","id":"<uuid>"}}`.
This is more verbose but self-describing and robust if we extend the key with
additional fields later. We favor this **object format** for clarity and
extensibility, at the cost of a slightly longer token.
- **Object format:** e.g.
`{"dir":"Next","key":{"created_at":"2025-10-10T19:17:56Z","id":"<uuid>"}}`.
This is more verbose but self-describing and robust if we extend the key with
additional fields later. We favour this **object format** for clarity and
extensibility, at the cost of a slightly longer token.
🤖 Prompt for AI Agents
In docs/keyset-pagination-design.md around lines 268 to 273, the text uses US
spelling "favor"; update it to en‑GB spelling by replacing "favor" with "favour"
(and scan nearby text for any other US/UK inconsistencies to keep the document
consistent). Ensure the sentence reads "...We favour this **object format** for
clarity and extensibility..." with no other changes.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant