Skip to content

Issue #21861: Migrate XpathRegressionNestedForDepthTest to verifyXpathWithInlineConfigParser - #22063

Merged
romani merged 1 commit into
checkstyle:masterfrom
markjoin123:cursor/xpath-nested-for-depth-24fc
Oct 21, 2026
Merged

romani merged 1 commit into
checkstyle:masterfrom
markjoin123:cursor/xpath-nested-for-depth-24fc

Conversation

@markjoin123

Copy link
Copy Markdown
Contributor

Issue: #21861

Migrated XpathRegressionNestedForDepthTest from runVerifications to verifyXpathWithInlineConfigParser, and removed its xpathTestsUseInlineConfigParser suppression.

  • Each input now has an inline NestedForDepth header. Default cases state max = (default)1. InputXpathNestedForDepthMax states the previous override max = 2.
  • Markers are // violation below with the check message (Nested for depth is N (max allowed is M).). A same-line marker would exceed the 100-character line limit on these inputs.
  • Expected lines move by +8 (7-line header plus the marker line). Columns stay 17, 21, and 21. XPath queries are unchanged and do not reference comment nodes.
  • java.io.File and DefaultConfiguration are no longer used by the test.

Verified on master 7092d5fe55, JDK 21.0.12:

$ ./mvnw -B test -Dtest=XpathRegressionNestedForDepthTest -DfailIfNoTests=false
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

$ ./mvnw -B jacoco:restore-instrumented-classes antrun:run@ant-phase-verify
[INFO] BUILD SUCCESS

The ant run is the project checkstyle self-check (checkstyle-checks.xml, non-main files, resources, input, and examples).

@utafrali utafrali left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clean migration from runVerifications to verifyXpathWithInlineConfigParser. Line-number math checks out (7+8=15, 8+8=16, 8+8=16), columns 17/21/21 are preserved, header format with the trailing blank lines matches the inline-config-parser convention, and the suppressions.xml entry is correctly dropped. The 'violation below' placement is justified by the 100-char line limit.

@romani

romani commented Oct 19, 2026

Copy link
Copy Markdown
Member

Please read and watch playlist videos at Starting_Development.
Please make CI green.

@cursor
cursor Bot force-pushed the cursor/xpath-nested-for-depth-24fc branch from a1285d5 to d0221b0 Compare October 20, 2026 13:18
@cursor
cursor Bot force-pushed the cursor/xpath-nested-for-depth-24fc branch from d0221b0 to 667d0a7 Compare October 21, 2026 01:30

@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 07b14e0 into checkstyle:master Oct 21, 2026
80 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.

3 participants