Issue #17449: Add XDocs examples for MethodCountCheck max* properties
Issue: #17449
This PR adds XDocs examples for the following MethodCountCheck properties:
maxPrivatemaxPackagemaxProtected
Changes included:
- Added a new example configuration and code snippet (
Example4) inmethodcount.xmlto demonstrate using separate maximums for private, package-private, and protected methods. - Added a corresponding XDocs example source file
Example4.javaundersrc/xdocs-examples/resources/com/puppycrawl/tools/checkstyle/checks/sizes/methodcount. - Updated
methodcount.xml.templateto wire in the new example using the standard<macro name="example">pattern. - Removed
MethodCountCheck(maxPrivate,maxPackage,maxProtected) from theSUPPRESSED_PROPERTIES_BY_CHECKmap inXdocsExampleFileTest, as these properties are now covered by XDocs examples.
Testing:
mvn -Pno-validations -DskipITs -DskipUTs=false test- Verified that
XdocsExampleFileTestnow passes without suppressions forMethodCountCheck.
Please read and watch videos at Starting_Development. Please make CI green.
@romani CI green
GitHub, generate website
https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6805c08_20251214171357/index.html
https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/6805c08_20251214171357/checks/sizes/methodcount.html#Examples
Please read and watch videos at Starting_Development. Please make CI green.
https://checkstyle.org/checks/sizes/methodcount.html#MethodCount
You might noticed that all examples are same by java code and changing only by comments. Please continue this approach. You can have 3 examples for each property to be used individually to show it's behavior idenpendetly
@romani DOne CI green