Skip to content

Make RegexpMultiline examples behaviorally unique - #22109

Merged
romani merged 1 commit into
checkstyle:masterfrom
ishu7w:fix-distinct-xdoc-example
Oct 25, 2026
Merged

romani merged 1 commit into
checkstyle:masterfrom
ishu7w:fix-distinct-xdoc-example

Conversation

@ishu7w

@ishu7w ishu7w commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Example 7 in the RegexpMultiline documentation produced the same violations as Example 5, so its separate configuration did not demonstrate distinct behavior. Update Example 7 to show case-insensitive matching, update its documented output and example test, and remove checks/regexp/regexpmultiline/ from the uniqueness-test suppression list.

Related to #21119.

Validation

  • ./mvnw -B -ntp -Djacoco.skip=true -Dtest=XdocsExampleFileTest#testAllModuleExamplesAreBehaviorallyUnique,RegexpMultilineCheckExamplesTest test (passed)

@romani

romani commented Oct 21, 2026

Copy link
Copy Markdown
Member

please rebase we merged AGENTS.md .
please consider it and make CI pass.

@romani

romani commented Oct 23, 2026

Copy link
Copy Markdown
Member

@ishu7w , please fix CI

@romani

romani commented Oct 23, 2026

Copy link
Copy Markdown
Member
[ERROR] Failures: 
[ERROR]   XdocsExamplesAstConsistencyTest.testExampleCountMatchesPropertyCount:279 Found 1 module(s) whose example count does not match property count + 1.

Directory: checks/regexp/regexpmultiline
Properties: 7
Expected AST-matching examples: 8
Actual largest AST-matching group: 7 (of 8 total example files)


expected to be empty
but was:
    [Directory: checks/regexp/regexpmultiline
    Properties: 7
    Expected AST-matching examples: 8
    Actual largest AST-matching group: 7 (of 8 total example files)]
[ERROR]   XdocsExamplesAstConsistencyTest.testExamplesDifferOnlyByComments:213 Found 1 example files with AST mismatches.

Directory: checks/regexp/regexpmultiline
Reference: Example1.java
Mismatch:  Example7.java
Reason:    AST structure mismatch (line numbers differ only - check for added/removed blank lines or shifted code)

Note: a mismatch reason of "line numbers differ only" usually means an example has an extra/missing blank line or shifted code relative to its reference - fix the line alignment before considering suppression.
"checks/regexp/regexpmultiline/Example7",

expected to be empty
but was:
    [Directory: checks/regexp/regexpmultiline
    Reference: Example1.java
    Mismatch:  Example7.java
    Reason:    AST structure mismatch (line numbers differ only - check for added/removed blank lines or shifted code)]
[INFO] 
[ERROR] Tests run: 7075, Failures: 2, Errors: 0, Skipped: 2

please fix

@ishu7w
ishu7w force-pushed the fix-distinct-xdoc-example branch from 602c298 to 98bd960 Compare October 23, 2026 15:13
ishu7w added a commit to ishu7w/checkstyle that referenced this pull request Oct 23, 2026
@romani

romani commented Oct 23, 2026

Copy link
Copy Markdown
Member

CI still red

@romani

romani commented Oct 23, 2026

Copy link
Copy Markdown
Member

Run on local mvnw clean verify

@ishu7w
ishu7w force-pushed the fix-distinct-xdoc-example branch from 98bd960 to 3c52aaf Compare October 23, 2026 15:53
ishu7w added a commit to ishu7w/checkstyle that referenced this pull request Oct 23, 2026
@romani

romani commented Oct 24, 2026

Copy link
Copy Markdown
Member

Conflict , sorry, please resolve it again

@ishu7w
ishu7w force-pushed the fix-distinct-xdoc-example branch from 3c52aaf to 82a63ee Compare October 25, 2026 06:31
ishu7w added a commit to ishu7w/checkstyle that referenced this pull request Oct 25, 2026

@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

*/
private static final Set<String> SUPPRESSED_UNIQUENESS_CHECK_MODULES = Set.of(
"checks/regexp/regexpmultiline/",
"checks/outertypefilename/",

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.

Just remove your check, no adding

@ishu7w
ishu7w force-pushed the fix-distinct-xdoc-example branch from 82a63ee to 41e320d Compare October 25, 2026 06:59

@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 85f1651 into checkstyle:master Oct 25, 2026
136 checks passed
@github-actions github-actions Bot added this to the 14.4.0 milestone Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants