Skip to content

Issue #16621: Improve SuppressionSingleFilter examples#18125

Merged
romani merged 1 commit into
checkstyle:masterfrom
talib007-56:issue-16621-suppressionsinglefilter-examples
Nov 20, 2025
Merged

Issue #16621: Improve SuppressionSingleFilter examples#18125
romani merged 1 commit into
checkstyle:masterfrom
talib007-56:issue-16621-suppressionsinglefilter-examples

Conversation

@talib007-56

@talib007-56 talib007-56 commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Fixes #16729

Summary

This PR improves the SuppressionSingleFilter documentation examples by reducing redundancy and adding demonstrations of the columns and id properties that were previously missing.

Changes Made

  • Reduced examples from 10 to 4 (60% reduction) to minimize redundancy
  • Added columns property example (Example 2): Demonstrates suppressing violations at specific column positions
  • Added id property example (Example 4): Demonstrates suppressing violations by module ID
  • Removed redundant Examples 5-10: These examples only showed basic files+checks combinations without demonstrating unique filter capabilities

Updated Examples Structure

  1. Example 1 (Unchanged): Demonstrates lines property with ranges and multiple checks
  2. Example 2 (Modified): Now demonstrates columns property usage with NoWhitespaceAfter check
  3. Example 3 (Unchanged): Shows RegexpSinglelineCheck (Checker-level check)
  4. Example 4 (Modified): Now demonstrates id property usage with MemberName check

Files Changed

  • src/site/xdoc/filters/suppressionsinglefilter.xml - Updated documentation
  • src/xdocs-examples/java/.../SuppressionSingleFilterExamplesTest.java - Updated test cases for 4 examples
  • src/xdocs-examples/resources/.../Example2.java - Changed to show column filtering
  • src/xdocs-examples/resources/.../Example4.java - Changed to show id filtering

Testing

  • All 4 example tests pass successfully
  • Tests verify the correct suppression behavior for each property

@talib007-56 talib007-56 force-pushed the issue-16621-suppressionsinglefilter-examples branch 2 times, most recently from 97c79bc to 0e79472 Compare November 18, 2025 10:15
@romani

romani commented Nov 18, 2025

Copy link
Copy Markdown
Member

single commit please, CI complains about merge commit.

@romani

romani commented Nov 18, 2025

Copy link
Copy Markdown
Member

please reference #16729 in PR and commit

@romani

romani commented Nov 18, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@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:

final String[] expectedWithFilter = {};

verifyFilterWithInlineConfigParser(getPath("Example8.java"),
expectedWithoutFilter, expectedWithFilter);

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.

you need to remove Example8 from repo, as it become unused.

do same for other exampleX

@romani

romani commented Nov 18, 2025

Copy link
Copy Markdown
Member

As you can see that web site did not change much, you need to update template file in xdoc folder for this module.

@talib007-56 talib007-56 force-pushed the issue-16621-suppressionsinglefilter-examples branch from 4e8774a to 3987e80 Compare November 19, 2025 09:55
@talib007-56

Copy link
Copy Markdown
Contributor Author

i made all the changes you said only pr description check is failing

@romani

romani commented Nov 19, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@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.

Last

Comment thread src/site/xdoc/filters/suppressionsinglefilter.xml Outdated
@talib007-56 talib007-56 force-pushed the issue-16621-suppressionsinglefilter-examples branch from 3987e80 to 54d0f6f Compare November 20, 2025 10:04
@romani

romani commented Nov 20, 2025

Copy link
Copy Markdown
Member

GitHub, generate website

@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.

thanks a lot

@romani romani merged commit 0133399 into checkstyle:master Nov 20, 2025
122 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.

Update SuppressionSingleFilter examples to use all properties

2 participants