Skip to content

Comments

docs(linter): Raise error if rule docs contain unclosed markdown codeblocks.#17889

Merged
graphite-app[bot] merged 1 commit intomainfrom
prevent-missing-backticks
Jan 11, 2026
Merged

docs(linter): Raise error if rule docs contain unclosed markdown codeblocks.#17889
graphite-app[bot] merged 1 commit intomainfrom
prevent-missing-backticks

Conversation

@connorshea
Copy link
Member

AI Disclosure: Used GitHub Copilot + Raptor mini for help with this, have code reviewed and confirmed the behavior is correct after adding an invalid codeblock. The implementation is a bit naive (markdown technically allows 4 backticks in some situations, for example, and this doesn't technically catch whether that is closed properly), but I think it should be fine if it works fine with all 650 rules we already have.

This will prevent a somewhat-common mistake in the rule documentation where we unintentionally have invalid markdown. Now, the rule will fail if the docs are invalid in this way. e.g. see #17888.

We should maybe consider updating the macro to also error on certain missing headers, but that's a future concern.

Copilot AI review requested due to automatic review settings January 11, 2026 19:47
@github-actions github-actions bot added the C-docs Category - Documentation. Related to user-facing or internal documentation label Jan 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds validation to the declare_oxc_lint! macro to detect unclosed markdown code fences (triple backticks) in rule documentation. This helps prevent common documentation errors where code blocks are accidentally left unclosed.

Changes:

  • Added tracking of triple backtick occurrences in rule documentation comments
  • Added validation to ensure code fences are properly paired (even count)
  • Generates compile-time error with helpful message when unclosed code blocks are detected

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 11, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 41 skipped benchmarks1


Comparing prevent-missing-backticks (18b0028) with main (1e5ae93)

Open in CodSpeed

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 11, 2026
@camc314 camc314 self-assigned this Jan 11, 2026
Copy link
Contributor

camc314 commented Jan 11, 2026

Merge activity

…blocks. (#17889)

AI Disclosure: Used GitHub Copilot + Raptor mini for help with this, have code reviewed and confirmed the behavior is correct after adding an invalid codeblock. The implementation is a bit naive (markdown technically allows 4 backticks in some situations, for example, and this doesn't technically catch whether that is closed properly), but I think it should be fine if it works fine with all 650 rules we already have.

This will prevent a somewhat-common mistake in the rule documentation where we unintentionally have invalid markdown. Now, the rule will fail if the docs are invalid in this way. e.g. see #17888.

We should maybe consider updating the macro to also error on certain missing headers, but that's a future concern.
@graphite-app graphite-app bot force-pushed the prevent-missing-backticks branch from 18b0028 to 2b11d4d Compare January 11, 2026 20:54
@graphite-app graphite-app bot merged commit 2b11d4d into main Jan 11, 2026
20 checks passed
@graphite-app graphite-app bot deleted the prevent-missing-backticks branch January 11, 2026 21:01
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants