Skip to content

Add doc examples for table helpers#142

Merged
leynos merged 5 commits intomainfrom
codex/add-rustdoc-examples-to-functions
Jul 31, 2025
Merged

Add doc examples for table helpers#142
leynos merged 5 commits intomainfrom
codex/add-rustdoc-examples-to-functions

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 29, 2025

Summary

  • document format_breaks with a simple Rustdoc example
  • add examples to split_cells and reflow_table
  • run make fmt, make lint and make test

Testing

  • make fmt
  • make lint
  • make test

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

Summary by Sourcery

Add usage examples to the Rustdoc comments for table helper functions and refine project documentation formatting.

Documentation:

  • Add Rustdoc examples for split_cells, reflow_table, and format_breaks to illustrate their usage
  • Refine line wrapping and spacing in AGENTS.md and README.md for consistent documentation formatting

Chores:

  • Apply code formatting and lint fixes by running make fmt, make lint, and make test

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jul 29, 2025

Reviewer's Guide

This PR enriches the library documentation by adding Rustdoc examples to the split_cells, reflow_table, and format_breaks functions to illustrate typical usage and behavior, and cleans up project docs by wrapping lines in AGENTS.md and adjusting whitespace in README.md for consistency.

Class diagram for updated table helper functions documentation

classDiagram
    class split_cells {
        +Vec<String> split_cells(line: &str)
        """Split a Markdown table row into individual cell strings.
        Escaped pipe characters (\|) are treated as literals and whitespace inside each cell is trimmed.
        Example usage provided in docs."""
    }
    class reflow_table {
        +Vec<String> reflow_table(lines: &[String])
        """Reflow a Markdown table so columns align uniformly.
        Invalid tables are returned unchanged.
        Example usage provided in docs."""
    }
    class format_breaks {
        +Vec<Cow<'_, str>> format_breaks(lines: &[String])
        """Normalize thematic breaks outside fenced code blocks.
        Consecutive hyphens, asterisks or underscores are replaced with a standardised line of underscores.
        Example usage provided in docs."""
    }
Loading

File-Level Changes

Change Details Files
Expand Rustdoc for split_cells and reflow_table
  • Add example demonstrating split_cells behavior with escaped pipes and trimming
  • Add example demonstrating reflow_table behavior with uniform column alignment
src/table.rs
Document format_breaks with an example
  • Illustrate normalization of thematic breaks outside fenced code blocks
src/breaks.rs
Polish project documentation formatting
  • Wrap long lines and reflow text in AGENTS.md
  • Adjust spacing in README.md for punctuation consistency
AGENTS.md
README.md

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 Jul 29, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new function to automatically reflow and align Markdown tables for improved readability.
  • Documentation

    • Improved documentation for handling thematic breaks and table formatting, including usage examples.
    • Corrected minor typographical and formatting issues in the documentation.
  • Refactor

    • Simplified table cell splitting logic for better maintainability and reliability.

Walkthrough

Apply editorial and formatting improvements to AGENTS.md, including spelling corrections and line break adjustments. Add a comprehensive doc comment to format_breaks in src/breaks.rs. Refactor split_cells in src/table.rs to use regex, remove a helper, and introduce a new reflow_table function for Markdown tables.

Changes

Cohort / File(s) Change Summary
Editorial & Formatting: AGENTS.md
AGENTS.md
Refine line breaks, correct spelling, and adjust punctuation for clarity and consistency; no substantive content changes.
Doc Comment Addition: format_breaks
src/breaks.rs
Add a detailed doc comment to the public format_breaks function, describing its behaviour, usage, and example output. Implementation remains unchanged.
Table Parsing & Reflow Refactor
src/table.rs
Refactor split_cells to use regex for escaped pipe handling; remove the now-unnecessary next_is_pipe helper. Add new public reflow_table function to reflow Markdown tables with aligned columns and documentation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TableModule as src/table.rs
    User->>TableModule: Call reflow_table(lines)
    TableModule->>TableModule: Parse table lines, validate structure
    TableModule->>TableModule: Calculate column widths
    TableModule->>TableModule: Align and format table rows
    TableModule-->>User: Return reflowed table as Vec<String>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • Fix reflow issues #10: Refactors split_cells and improves reflow_table formatting and edge case handling, directly modifying the same functions as this PR.
  • Refactor table reflow helpers #87: Refactors reflow_table into smaller helpers and introduces a ParsedTable struct, closely related to the new reflow_table function added here.
  • Add thematic break formatting #57: Originally introduced the format_breaks function and CLI support; this PR adds documentation to that same function.

Poem

Tables aligned, pipes now tamed,
With regex magic, parsing’s renamed.
Breaks are explained, docs shining bright,
Markdown flows crisp, columns just right.
Edits and comments, all in their place—
This PR brings order, with structured grace!
✨📄


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7aa9c11 and 7af63ac.

📒 Files selected for processing (1)
  • AGENTS.md (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.

Files:

  • AGENTS.md

⚙️ CodeRabbit Configuration File

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

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • 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:

  • AGENTS.md
🧠 Learnings (1)
AGENTS.md (4)

Learnt from: CR
PR: leynos/comenq#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:57:05.353Z
Learning: Applies to Cargo.toml : Prohibit unstable version specifiers: The use of wildcard (*) or open-ended inequality (>=) version requirements is strictly forbidden as they introduce unacceptable risk and unpredictability. Tilde requirements (~) should only be used where a dependency must be locked to patch-level updates for a specific, documented reason.

Learnt from: CR
PR: leynos/mdtablefix#0
File: AGENTS.md:0-0
Timestamp: 2025-07-29T12:44:22.976Z
Learning: Applies to Cargo.toml : Prohibit unstable version specifiers: The use of wildcard (*) or open-ended inequality (>=) version requirements is strictly forbidden as they introduce unacceptable risk and unpredictability. Tilde requirements (~) should only be used where a dependency must be locked to patch-level updates for a specific, documented reason.

Learnt from: CR
PR: leynos/lille#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T12:14:14.253Z
Learning: Applies to Cargo.toml : Prohibit unstable version specifiers: The use of wildcard (*) or open-ended inequality (>=) version requirements is strictly forbidden as they introduce unacceptable risk and unpredictability. Tilde requirements (~) should only be used where a dependency must be locked to patch-level updates for a specific, documented reason.

Learnt from: CR
PR: leynos/netsuke#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T17:57:57.505Z
Learning: Applies to Cargo.toml : Prohibit unstable version specifiers: The use of wildcard (*) or open-ended inequality (>=) version requirements is strictly forbidden. Tilde requirements (~) should only be used where a dependency must be locked to patch-level updates for a specific, documented reason.

🪛 LanguageTool
AGENTS.md

[uncategorized] ~33-~33: Do not mix variants of the same word (‘co-locate’ and ‘colocate’) within a single text.
Context: ...broken up by feature and constituents co-located with targets. Large blocks of test data...

(EN_WORD_COHERENCY)

🔇 Additional comments (2)
AGENTS.md (2)

160-163: Text update passes all style gates

Line wrapping, en-GB spelling, and comma insertion are correct.
No further action required.


31-34: Standardise “co-locate” spelling

The document now contains both “Colocate” (Line 22) and “co-located” (Line 33).
Use a single variant throughout to avoid variant mixing flagged by LanguageTool.

- - **Group by feature, not layer.** Colocate views, logic, fixtures, and helpers
+ - **Group by feature, not layer.** Co-locate views, logic, fixtures, and helpers
⛔ Skipped due to learnings
Learnt from: CR
PR: leynos/femtologging#0
File: AGENTS.md:0-0
Timestamp: 2025-07-28T19:14:46.188Z
Learning: Keep file size manageable. No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/netsuke#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T17:57:57.505Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/mdtablefix#0
File: AGENTS.md:0-0
Timestamp: 2025-07-29T12:44:22.976Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/lille#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T12:14:14.253Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/vk#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:37:06.651Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/comenq#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:57:05.353Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
Learnt from: CR
PR: leynos/wireframe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T13:30:09.180Z
Learning: Keep file size manageable: No single code file may be longer than 400 lines. Long switch statements or dispatch tables should be broken up by feature and constituents colocated with targets. Large blocks of test data should be moved to external data files.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-rustdoc-examples-to-functions

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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 @leynos - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `AGENTS.md:31` </location>
<code_context>
+  examples demonstrating the usage and outcome of the function. Test
+  documentation should omit examples where the example serves only to reiterate
+  the test logic.
+- **Keep file size managable.** No single code file may be longer than 400
+  lines. Long switch statements or dispatch tables should be broken up by
+  feature and constituents colocated with targets. Large blocks of test data
</code_context>

<issue_to_address>
Typo: 'managable' should be 'manageable'.

Please correct the spelling to 'manageable'.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
- **Keep file size managable.** No single code file may be longer than 400
  lines. Long switch statements or dispatch tables should be broken up by
  feature and constituents colocated with targets. Large blocks of test data
=======
- **Keep file size manageable.** No single code file may be longer than 400
  lines. Long switch statements or dispatch tables should be broken up by
  feature and constituents colocated with targets. Large blocks of test data
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `src/table.rs:32` </location>
<code_context>
+///     vec!["a".to_string(), "b | c".to_string(), "d".to_string()]
+/// );
+/// ```
 pub fn split_cells(line: &str) -> Vec<String> {
     let mut s = line.trim();
     if let Some(stripped) = s.strip_prefix('|') {
</code_context>

<issue_to_address>
Consider replacing the manual loop in split_cells with a regex-based split and map for cleaner and more maintainable code.

```suggestion
You can collapse all the manual peek/loop logic in `split_cells` into a single regex‐based split and a map cleanup. This preserves escaped “\|” and trimming:

```rust
use once_cell::sync::Lazy;
use regex::Regex;

// match an unescaped '|' (i.e. not preceded by backslash)
static UNESCAPED_PIPE: Lazy<Regex> = Lazy::new(|| {
    Regex::new(r"(?<!\\)\|").unwrap()
});

pub fn split_cells(line: &str) -> Vec<String> {
    // strip outer pipes and trim
    let s = line.trim().trim_start_matches('|').trim_end_matches('|');
    UNESCAPED_PIPE
        .split(s)
        .map(|cell| {
            cell
                .trim()
                .replace(r"\|", "|")  // unescape literal pipes
        })
        .collect()
}
```

This:
- drops the manual `peekable` loop entirely
- still trims whitespace per cell
- preserves `\|` escapes
- compiles the regex once via `Lazy` for performance
```
</issue_to_address>

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.

Comment thread AGENTS.md Outdated
Comment thread src/table.rs
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jul 30, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 30, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Copy Markdown

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 30, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

♻️ Duplicate comments (1)
src/table.rs (1)

31-39: Well-implemented regex-based refactor

The regex-based approach with placeholder replacement effectively addresses the previous review suggestion whilst maintaining the same functionality. The implementation is clean and more maintainable than the previous manual parsing approach.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35b50b8 and 2b22c28.

📒 Files selected for processing (4)
  • AGENTS.md (4 hunks)
  • README.md (1 hunks)
  • src/breaks.rs (1 hunks)
  • src/table.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

⚙️ CodeRabbit Configuration File

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

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • 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:

  • AGENTS.md
  • README.md
**/*.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • src/breaks.rs
  • src/table.rs
🧠 Learnings (1)
AGENTS.md (10)

Learnt from: CR
PR: leynos/rstest-bdd#0
File: AGENTS.md:0-0
Timestamp: 2025-07-22T06:27:02.647Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/ortho-config#0
File: AGENTS.md:0-0
Timestamp: 2025-07-20T21:31:16.982Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/comenq#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:57:05.353Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/lille#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T12:14:14.253Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/mdtablefix#0
File: AGENTS.md:0-0
Timestamp: 2025-07-29T12:44:22.976Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/ddlint#0
File: AGENTS.md:0-0
Timestamp: 2025-07-18T18:35:14.639Z
Learning: Applies to docs/**/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/vk#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:37:06.651Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/femtologging#0
File: AGENTS.md:0-0
Timestamp: 2025-07-28T19:14:46.188Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/wireframe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T13:30:09.180Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/netsuke#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T17:57:57.505Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

🪛 LanguageTool
AGENTS.md

[locale-violation] ~46-~46: LICENSE must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged ...

(LICENCE_LICENSE_NOUN_SINGULAR)


[uncategorized] ~160-~160: Possible missing comma found.
Context: ...(>=) version requirements is strictly forbidden as they introduce unacceptable risk a...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (9)
AGENTS.md (5)

12-13: LGTM - Clear text rewrapping

The rewrapping improves readability whilst maintaining the original meaning.


28-31: LGTM - Editorial improvements enhance clarity

The text restructuring with proper line breaks and spacing improves readability without altering the substantive guidance.


31-34: LGTM - Consistent formatting applied

The rewrapping maintains the 80-column guideline whilst preserving the technical content.


46-47: LGTM - LICENSE exception correctly maintained

The spacing adjustment improves readability whilst correctly preserving the LICENSE naming exception as documented in the retrieved learnings.


167-169: LGTM - Technical content properly formatted

The rewrapping maintains clarity whilst adhering to line length guidelines.

src/breaks.rs (1)

19-42: Excellent documentation with comprehensive example

The doc comment clearly explains the function's behaviour and includes a practical example demonstrating both usage and expected output. The en-GB spelling ("standardised") correctly follows the project guidelines.

src/table.rs (3)

9-10: LGTM - Clean regex implementation

The static regex for escaped pipes provides an efficient, reusable pattern for the refactored split_cells function.


13-30: Excellent documentation with clear examples

The doc comment provides comprehensive usage examples that demonstrate both basic functionality and escaped pipe handling. The examples clearly show the expected input-output behaviour.


159-177: Comprehensive documentation for new public function

The doc comment provides a clear description and practical example demonstrating the table reflow functionality. The example effectively shows both input and expected output format.

Comment thread AGENTS.md Outdated
Comment thread README.md
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b22c28 and 761f81d.

📒 Files selected for processing (1)
  • AGENTS.md (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.md: Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.
Use dashes (-) for list bullets.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.

Files:

  • AGENTS.md

⚙️ CodeRabbit Configuration File

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

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • 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:

  • AGENTS.md
🧠 Learnings (1)
AGENTS.md (10)

Learnt from: CR
PR: leynos/rstest-bdd#0
File: AGENTS.md:0-0
Timestamp: 2025-07-22T06:27:02.647Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/ortho-config#0
File: AGENTS.md:0-0
Timestamp: 2025-07-20T21:31:16.982Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/comenq#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:57:05.353Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/lille#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T12:14:14.253Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/mdtablefix#0
File: AGENTS.md:0-0
Timestamp: 2025-07-29T12:44:22.976Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/ddlint#0
File: AGENTS.md:0-0
Timestamp: 2025-07-18T18:35:14.639Z
Learning: Applies to docs/**/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/vk#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:37:06.651Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/femtologging#0
File: AGENTS.md:0-0
Timestamp: 2025-07-28T19:14:46.188Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/wireframe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T13:30:09.180Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/netsuke#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T17:57:57.505Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

🪛 LanguageTool
AGENTS.md

[locale-violation] ~46-~46: LICENSE must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged ...

(LICENCE_LICENSE_NOUN_SINGULAR)

🔇 Additional comments (1)
AGENTS.md (1)

46-47: LGTM – exception wording is correct

The explicit reference to the “LICENSE” filename is intentional and aligns with the documented exception. No changes needed.

Comment thread AGENTS.md
Comment thread AGENTS.md
Comment thread AGENTS.md Outdated
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jul 31, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 31, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 1

♻️ Duplicate comments (1)
AGENTS.md (1)

12-13: Delete the superfluous comma after “comprehensions”.

Maintain smooth flow and stay aligned with prior review guidance.

-  logic. Prefer generators or comprehensions, and declarative code to
+  logic. Prefer generators or comprehensions and declarative code to
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 761f81d and 7aa9c11.

📒 Files selected for processing (1)
  • AGENTS.md (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

⚙️ CodeRabbit Configuration File

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

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • 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:

  • AGENTS.md
🧠 Learnings (1)
AGENTS.md (10)

Learnt from: CR
PR: leynos/ortho-config#0
File: AGENTS.md:0-0
Timestamp: 2025-07-20T21:31:16.982Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/rstest-bdd#0
File: AGENTS.md:0-0
Timestamp: 2025-07-22T06:27:02.647Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/comenq#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:57:05.353Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/lille#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T12:14:14.253Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/mdtablefix#0
File: AGENTS.md:0-0
Timestamp: 2025-07-29T12:44:22.976Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged for community consistency.)

Learnt from: CR
PR: leynos/ddlint#0
File: AGENTS.md:0-0
Timestamp: 2025-07-18T18:35:14.639Z
Learning: Applies to docs/**/*.md : Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

Learnt from: CR
PR: leynos/vk#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T00:37:06.651Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/femtologging#0
File: AGENTS.md:0-0
Timestamp: 2025-07-28T19:14:46.188Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/wireframe#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T13:30:09.180Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

Learnt from: CR
PR: leynos/netsuke#0
File: AGENTS.md:0-0
Timestamp: 2025-07-27T17:57:57.505Z
Learning: Applies to **/*.md : Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.

🪛 LanguageTool
AGENTS.md

[uncategorized] ~33-~33: Do not mix variants of the same word (‘co-locate’ and ‘colocate’) within a single text.
Context: ...broken up by feature and constituents co-located with targets. Large blocks of test data...

(EN_WORD_COHERENCY)


[locale-violation] ~46-~46: LICENSE must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...grammar. (EXCEPTION: the naming of the "LICENSE" file, which is to be left unchanged ...

(LICENCE_LICENSE_NOUN_SINGULAR)

🔇 Additional comments (5)
AGENTS.md (5)

28-30: Usage-example guidance reads well.

The re-phrased bullet is clear and within 80-column limits.


31-34: Hyphenation fix accepted.

“Co-located” now follows en-GB orthography.


46-47: Licence naming exception correctly retained.

No action required.


157-158: Caret-range rationale is concise and correct.

Good addition.


160-163: Pronoun agreement fixed.

Sentence is now grammatically sound.

Comment thread AGENTS.md
@leynos leynos merged commit bf223d4 into main Jul 31, 2025
2 checks passed
@leynos leynos deleted the codex/add-rustdoc-examples-to-functions branch July 31, 2025 15:11
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