Skip to content

docs(footnotes): document parse_definition and is_definition_continuation (#367) - #413

Open
lodyai[bot] wants to merge 2 commits into
mainfrom
issue-367-docs-footnotes-add-doc-comments-to-parse-definition-and-is-definition-continuation
Open

docs(footnotes): document parse_definition and is_definition_continuation (#367)#413
lodyai[bot] wants to merge 2 commits into
mainfrom
issue-367-docs-footnotes-add-doc-comments-to-parse-definition-and-is-definition-continuation

Conversation

@lodyai

@lodyai lodyai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Add /// doc comments to the two pub(super) entry points of the footnotes
parsing module in src/footnotes/parsing.rs:

  • parse_definition — documents that it parses a footnote definition line
    into DefinitionParts (matching DEF_RE: optional blockquote prefix, [^N]:
    marker with a decimal number, and trailing text), that prefix/rest borrow
    from the input, and that it returns None when the line is not a definition
    or the number does not parse as a usize.
  • is_definition_continuation — documents that a continuation is any line
    whose first character is whitespace (indented body text belonging to the
    definition above), and that an empty line returns false.

These helpers form the module's parsing interface, consumed across the
renumber and lists submodules, and previously carried no documented
contract for their inputs, outputs, or the grammar they encode.

Comments use en-GB Oxford spelling.

Closes #367

Acceptance criteria

  • Both functions have /// doc comments stating inputs and outputs.
  • make lint/doc gates pass (fmt, clippy, typecheck, test, markdownlint, nixie all green).

References

🤖 Generated with Claude Code

Add `///` doc comments to `parse_definition` and
`is_definition_continuation` in `src/footnotes/parsing.rs`, describing
their inputs, return values, and the definition/continuation grammar they
encode. These `pub(super)` helpers form the footnotes module's parsing
interface, consumed across the renumber and lists submodules, and now
carry a documented contract.

Closes #367

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02da7105-2852-462e-9cc6-59fb20ae7ff0

📥 Commits

Reviewing files that changed from the base of the PR and between cbf7cb0 and cb89fdd.

📒 Files selected for processing (1)
  • src/footnotes/parsing.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-367-docs-footnotes-add-doc-comments-to-parse-definition-and-is-definition-continuation

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

@sourcery-ai sourcery-ai Bot left a comment

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.

Sorry @LodyAI[bot], you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@leynos
leynos marked this pull request as ready for review July 26, 2026 22:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71f61d0bff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/footnotes/parsing.rs
Comment on lines +24 to +32
/// Parses a footnote definition line into its constituent [`DefinitionParts`].
///
/// A definition matches [`DEF_RE`]: an optional blockquote prefix (`>`
/// markers with surrounding whitespace), a `[^N]:` marker bearing a decimal
/// footnote number, and the trailing text following the colon. The borrowed
/// `prefix` and `rest` fields point into `line`.
///
/// Returns [`None`] when `line` is not a definition, or when the captured
/// number does not parse as a [`usize`].

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add an input/output example for parse_definition

This new function documentation describes the grammar but never provides an example showing how a representative definition is parsed into prefix, number, and rest, or how invalid input yields None. Add a concise usage-and-outcome example as required for all function documentation.

AGENTS.md reference: AGENTS.md:L27-L30

Useful? React with 👍 / 👎.

Comment thread src/footnotes/parsing.rs
Comment on lines +44 to +49
/// Reports whether `line` continues the preceding footnote definition.
///
/// A continuation is any line whose first character is whitespace, marking
/// indented body text that belongs to the definition above it rather than
/// beginning a new construct. An empty `line` has no leading character and so
/// returns `false`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add an input/output example for continuation detection

This new function documentation does not include an example demonstrating which inputs return true or false; in particular, an indented line and an empty or unindented line would make the whitespace-based contract immediately clear. Add a concise usage-and-outcome example as required for all function documentation.

AGENTS.md reference: AGENTS.md:L27-L30

Useful? React with 👍 / 👎.

Address review feedback: per the AGENTS.md convention that function
documentation include a clear usage-and-outcome example, add `# Examples`
sections to `parse_definition` and `is_definition_continuation`. The
examples use `text` code blocks (these `pub(super)` helpers are not part
of the public doctest surface) and show representative inputs alongside
their outcomes, making the whitespace and marker contracts immediate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(footnotes): add doc comments to parse_definition and is_definition_continuation

0 participants