Skip to content

Clarify Fenced-Content Example in a Docstring - #905

Merged
ptr727 merged 2 commits into
developfrom
fix/523-docstring-clarify
Aug 22, 2026
Merged

Clarify Fenced-Content Example in a Docstring#905
ptr727 merged 2 commits into
developfrom
fix/523-docstring-clarify

Conversation

@ptr727

@ptr727 ptr727 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #904, addressing a suppressed Copilot finding raised on the #900 -> #901 promotion PR review.

undeclared_h2_headings()'s docstring read as if a bare `##`-prefixed shell comment is never misread as a heading anywhere, when that only holds inside a fenced code sample, the same as the heading-syntax example right beside it. Reworded so both read as one example of fenced content rather than two independent claims.

Verification

  • `python3 spec/audit.py --selftest` -> `SELFTEST PASS`
  • `python3 spec/validate.py` -> `Spec validation OK`
  • `ruff check .` / `ruff format --check .` -> clean
  • `python3 scripts/prose_lint.py --diff origin/develop spec/audit.py` -> clean

Copilot (suppressed finding): the docstring read as if a bare
##-prefixed shell comment anywhere is never misread as a heading,
when it only holds inside a fenced code sample, the same as the
heading-syntax example beside it. Reworded so both are one example
of fenced content, not two independent claims.
Copilot AI lite review requested due to automatic review settings August 22, 2026 03:25
@ptr727 ptr727 mentioned this pull request Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5973ccf3-541a-466f-8223-80f3642d633d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Clarify fenced-code example in undeclared_h2_headings docstring

📝 Documentation 🕐 Less than 10 minutes

Grey Divider

AI Description

• Clarify that heading-like lines are ignored only within fenced code content.
• Reword docstring to present both examples as one fenced-content scenario.
High-Level Assessment

The PR’s approach (tightening docstring wording to avoid an incorrect generalization) is the simplest and most maintainable option. Alternatives like adding extra narrative or new examples would add verbosity without improving clarity.

Files changed (1) +2 / -2

Documentation (1) +2 / -2
audit.pyClarify fenced-content semantics in undeclared_h2_headings docstring +2/-2

Clarify fenced-content semantics in undeclared_h2_headings docstring

• Rewords the docstring to make clear that both the heading-syntax line and the '##' shell-comment example are shown inside a fenced code block, and therefore should not be treated as real headings.

spec/audit.py

Copilot AI 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.

🟡 Changes recommended

The updated docstring sentence is grammatically awkward (“or …, each shown …”) and should be rephrased for clarity.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Refines the undeclared_h2_headings() docstring in spec/audit.py to clarify that the “not misread as a real heading” claim applies to ##-prefixed examples when they are inside fenced code samples, aligning the wording with the neighboring fenced-content example.

Changes:

  • Reword the docstring’s fenced-content example so it reads as a single fenced-sample claim rather than two independent claims.
File summaries
File Description
spec/audit.py Updates the undeclared_h2_headings() docstring to clarify the fenced-content example and avoid implying unfenced ## lines are always safe.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread spec/audit.py Outdated
Copilot: "or ..., each shown" is grammatically awkward since "each"
implies both items while "or" implies alternation. Reworded to
"Either ... or ..., shown".
Copilot AI review requested due to automatic review settings August 22, 2026 03:28

Copilot AI 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.

🟢 Approval recommended

The change is a docstring-only clarification that aligns with the existing unfenced_text() behavior and does not alter runtime logic.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ptr727
ptr727 merged commit ca38109 into develop Aug 22, 2026
9 checks passed
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.

2 participants