Skip to content

fix(linter): Generate config option docs for primitive config options.#19731

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-docs-gen-for-single-arg
Feb 26, 2026
Merged

fix(linter): Generate config option docs for primitive config options.#19731
graphite-app[bot] merged 1 commit intomainfrom
fix-docs-gen-for-single-arg

Conversation

@connorshea
Copy link
Member

@connorshea connorshea commented Feb 26, 2026

Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely.

This fixes the problem by handling that case when generating docs. It fixes the docs for typescript/class-literal-property-style, node/handle-callback-err (not merged yet), and react/no-will-update-set-state.

I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted.

We discovered this problem in #19616

The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.

Copilot AI review requested due to automatic review settings February 26, 2026 01:45
@github-actions github-actions bot added the C-bug Category - Bug label Feb 26, 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 fixes a documentation generation bug where rules with primitive configuration options (single string/enum arguments) were missing their configuration section entirely in the generated documentation.

Changes:

  • Modified doc_page.rs to handle the case when section.to_md() returns empty for primitive configs by directly rendering the instance_type and default fields
  • Updated snapshot test to include examples of fixed rules (typescript/class-literal-property-style and react/no-will-update-set-state)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tasks/website_linter/src/rules/doc_page.rs Added fallback logic to render type and default info when to_md() returns empty for primitive config options
tasks/website_linter/src/rules/mod.rs Added two affected rules to the snapshot test filter list
tasks/website_linter/src/rules/snapshots/docs_rule_pages.snap Added generated documentation for the two newly included rules, showing correct configuration sections

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

camc314 commented Feb 26, 2026

Merge activity

graphite-app bot pushed a commit that referenced this pull request Feb 26, 2026
#19731)

Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely.

This fixes the problem by handling that case when generating docs. It fixes the docs for `typescript/class-literal-property-style`, `node/handle-callback-err` (not merged yet), and `react/no-will-update-set-state`.

I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted.

We discovered this problem in #19616

The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.
@graphite-app graphite-app bot force-pushed the fix-docs-gen-for-single-arg branch from 84e73e5 to 75b6782 Compare February 26, 2026 09:23
#19731)

Previously, we did not correctly handle config docs for rules that only take one primitive argument. As a result, some docs were missing the config section entirely.

This fixes the problem by handling that case when generating docs. It fixes the docs for `typescript/class-literal-property-style`, `node/handle-callback-err` (not merged yet), and `react/no-will-update-set-state`.

I have checked this change against the existing docs site, and no changes to the docs seem to be problematic here, only a small handful of rules were impacted.

We discovered this problem in #19616

The change to the docs generation itself was generated by Claude Code, I tested the change manually and verified it worked, and also added the two extra rules to the docs snapshot.
@graphite-app graphite-app bot force-pushed the fix-docs-gen-for-single-arg branch from 75b6782 to 5a7568d Compare February 26, 2026 09:27
@graphite-app graphite-app bot merged commit 5a7568d into main Feb 26, 2026
19 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 26, 2026
@graphite-app graphite-app bot deleted the fix-docs-gen-for-single-arg branch February 26, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants