Skip to content

Issue #17691 : Website Generation doesn't automatically reflect new c…#18217

Merged
romani merged 1 commit into
checkstyle:masterfrom
smita1078:newBranchMacro
Dec 7, 2025
Merged

Issue #17691 : Website Generation doesn't automatically reflect new c…#18217
romani merged 1 commit into
checkstyle:masterfrom
smita1078:newBranchMacro

Conversation

@smita1078

@smita1078 smita1078 commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

Fixes #17691

This PR introduces a new macro generate-checks-indexes to automatically generate category-specific index pages for Checkstyle checks. This macro works similarly to the existing allCheckSummaries macro but generates per-category index tables.

Problem

Previously, category index pages (e.g., src/site/xdoc/checks/javadoc/index.xml) had to be manually maintained. When check descriptions changed in Javadoc, these index files would become outdated, requiring manual updates to keep them in sync.

Solution

Implemented a Maven Doxia macro that:

  1. Scans all Check and Holder Java files in the source tree
  2. Extracts summaries from Javadoc @since tagged descriptions
  3. Groups checks by category (annotation, blocks, coding, design, etc.)
  4. Generates HTML table rows for each category with check name and summary
  5. Handles special cases:
    • Category remapping (e.g., indentationmisc)
    • Explicit category assignments (e.g., SuppressWarningsHolderannotation)
    • Separate "Holder Checks" sections when applicable

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good progress !!!

This macro works similarly to the existing allCheckSummaries macro but generates per-category index tables.

why we cannot update existing to have "package" as optional paramter ?


items:

Comment thread src/site/xdoc/checks/annotation/index.xml Outdated
Comment thread src/site/xdoc/checks/annotation/index.xml Outdated
Comment thread src/site/xdoc/checks/annotation/index.xml.template Outdated
Comment thread config/checkstyle-non-main-files-suppressions.xml Outdated
@smita1078

Copy link
Copy Markdown
Contributor Author

This macro works similarly to the existing allCheckSummaries macro but generates per-category index tables.

why we cannot update existing to have "package" as optional paramter ?

Can be done will explore this option as well

@smita1078 smita1078 force-pushed the newBranchMacro branch 5 times, most recently from 3375c5e to 4e6b9ea Compare December 2, 2025 04:18
@smita1078

Copy link
Copy Markdown
Contributor Author

github, generate site

@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/annotation/index.html#

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/blocks/index.html#Blocks_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/coding/index.html#Coding_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/design/index.html#Design_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/header/index.html#Headers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/imports/index.html#Imports_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/javadoc/index.html#Javadoc_Comments_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/metrics/index.html#Metrics_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/misc/index.html#Miscellaneous_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/modifier/index.html#Modifiers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/naming/index.html#Naming_Conventions_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/regexp/index.html#Regexp_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/sizes/index.html#Size_Violations_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4e6b9ea_20251202051348/checks/whitespace/index.html#Whitespace_Checks

@smita1078

Copy link
Copy Markdown
Contributor Author

why we cannot update existing to have "package" as optional paramter ?

Done

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

items:

Comment thread src/site/xdoc/checks/annotation/index.xml Outdated
Comment thread src/site/xdoc/checks/annotation/index.xml.template Outdated
@romani

romani commented Dec 2, 2025

Copy link
Copy Markdown
Member

@stoyanK7 , please help to review this PR

@stoyanK7 stoyanK7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good overall 👍 , three minor things (apart from the indentation that is already commented on)

Comment on lines +288 to +293
if (isHolder && "SuppressWarningsHolder".equals(simpleName)) {
packageName = ANNOTATION_PACKAGE;
}
else if (isHolder && "SuppressXpathWarningsHolder".equals(simpleName)) {
packageName = ANNOTATION_PACKAGE;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This could be simplified to

Suggested change
if (isHolder && "SuppressWarningsHolder".equals(simpleName)) {
packageName = ANNOTATION_PACKAGE;
}
else if (isHolder && "SuppressXpathWarningsHolder".equals(simpleName)) {
packageName = ANNOTATION_PACKAGE;
}
if (isHolder) {
packageName = ANNOTATION_PACKAGE;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can't resolve thread but it's done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Resolved.

Comment thread src/main/java/com/puppycrawl/tools/checkstyle/site/AllCheckSummaries.java Outdated
@smita1078 smita1078 force-pushed the newBranchMacro branch 7 times, most recently from bfa9d8f to ac8fed0 Compare December 3, 2025 15:22
@romani

romani commented Dec 3, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/annotation/index.html#

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/coding/index.html#Coding_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/design/index.html#Design_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/header/index.html#Headers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/imports/index.html#Imports_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/javadoc/index.html#Javadoc_Comments_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/metrics/index.html#Metrics_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/misc/index.html#Miscellaneous_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/modifier/index.html#Modifiers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/naming/index.html#Naming_Conventions_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/regexp/index.html#Regexp_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/sizes/index.html#Size_Violations_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/ac8fed0_20251203170216/checks/whitespace/index.html#Whitespace_Checks

Comment thread src/site/xdoc/checks/coding/index.xml Outdated
Comment thread src/site/xdoc/checks/coding/index.xml
@smita1078 smita1078 force-pushed the newBranchMacro branch 3 times, most recently from 7caae3b to 1027983 Compare December 5, 2025 16:13
@romani

romani commented Dec 5, 2025

Copy link
Copy Markdown
Member

@stoyanK7, please do comment and approval as you finish.

@smita1078 , please reply "done" to all addressed items. Let's not keep rooms for misunderstanding in this PR.

@smita1078

Copy link
Copy Markdown
Contributor Author

github, generate site

@github-actions

github-actions Bot commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks.html#Standard_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/annotation/index.html#

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/coding/index.html#Coding_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/design/index.html#Design_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/header/index.html#Headers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/imports/index.html#Imports_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/javadoc/index.html#Javadoc_Comments_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/metrics/index.html#Metrics_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/misc/index.html#Miscellaneous_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/modifier/index.html#Modifiers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/naming/index.html#Naming_Conventions_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/regexp/index.html#Regexp_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/sizes/index.html#Size_Violations_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1027983_20251206025104/checks/whitespace/index.html#Whitespace_Checks

@stoyanK7

stoyanK7 commented Dec 6, 2025

Copy link
Copy Markdown
Collaborator

Did one final pass and everything looks good. Nice work, @smita1078 !

Approved 👍

Comment thread src/site/xdoc/checks/coding/index.xml Outdated
@smita1078 smita1078 force-pushed the newBranchMacro branch 3 times, most recently from dd40d2c to 9ba4e93 Compare December 6, 2025 18:31
@smita1078

Copy link
Copy Markdown
Contributor Author

github, generate site

@github-actions

github-actions Bot commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks.html#Standard_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/annotation/index.html#

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/coding/index.html#Coding_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/design/index.html#Design_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/header/index.html#Headers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/imports/index.html#Imports_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/javadoc/index.html#Javadoc_Comments_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/metrics/index.html#Metrics_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/misc/index.html#Miscellaneous_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/modifier/index.html#Modifiers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/naming/index.html#Naming_Conventions_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/regexp/index.html#Regexp_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/sizes/index.html#Size_Violations_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/9ba4e93_20251206185350/checks/whitespace/index.html#Whitespace_Checks

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very good.
Item from me:

<!-- no since in module by design -->
<suppress id="sinceMacroMustExist"
files="src[\\/]site[\\/]xdoc[\\/]checks\.xml\.template"/>
files="src[\\/]site[\\/]xdoc[\\/]checks([\\/][a-z]+)?[\\/]index\.xml\.template|src[\\/]site[\\/]xdoc[\\/]checks\.xml\.template|src[\\/]site[\\/]xdoc[\\/]checks[\\/][a-z]+\.xml"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of complicated to read single suppression tag, let's have few tags with simple content for "files" attribute.
It will be a way easier to maintain it, and it can have special excuse comment to explain reason of suppression.
Apply to all others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@romani

romani commented Dec 7, 2025

Copy link
Copy Markdown
Member

@stoyanK7, for future you can approve in GitHub UI, it will keep gray check mark, very clear signal that you approved PR. Approval by comment might be not easy to find in long PR.

@stoyanK7 stoyanK7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@romani Just found the button. I thought I had no permissions to approve, because I could not find an approval button, but it turns out it's not where I am used to finding it.

@smita1078 smita1078 force-pushed the newBranchMacro branch 6 times, most recently from 5178361 to 3334b81 Compare December 7, 2025 10:31
@smita1078

Copy link
Copy Markdown
Contributor Author

github, generate site

@github-actions

github-actions Bot commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks.html#Standard_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/annotation/index.html#

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/coding/index.html#Coding_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/design/index.html#Design_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/header/index.html#Headers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/imports/index.html#Imports_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/javadoc/index.html#Javadoc_Comments_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/metrics/index.html#Metrics_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/misc/index.html#Miscellaneous_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/modifier/index.html#Modifiers_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/naming/index.html#Naming_Conventions_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/regexp/index.html#Regexp_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/sizes/index.html#Size_Violations_Checks

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8249db4_20251207110457/checks/whitespace/index.html#Whitespace_Checks

@smita1078

Copy link
Copy Markdown
Contributor Author

All done 👍
I am not able to understand why ci/semaphore is failing

@romani

romani commented Dec 7, 2025

Copy link
Copy Markdown
Member

Everyone is welcome to review PRs, the more reviews the better, and even approve. Maintainers are who take responsibility to do final check that all is good and merge.

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Crazy complicated update.
Impressive work.
This huge leap forward., I hope future contributors appreciate simplicity to write new Check

@romani romani merged commit d9f53a1 into checkstyle:master Dec 7, 2025
122 of 123 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.

Website Generation doesn't automatically reflect new changes to checks.xml and checks/<type>/index.xml

3 participants