Skip to content

[core] Include XML validation details in ruleset loading errors - #7130

Merged
UncleOwen merged 2 commits into
pmd:mainfrom
noor-ahmadi:fix_ruleset_validation_details
Oct 4, 2026
Merged

UncleOwen merged 2 commits into
pmd:mainfrom
noor-ahmadi:fix_ruleset_validation_details

Conversation

@noor-ahmadi

Copy link
Copy Markdown
Contributor

Describe the PR

When RuleSetLoader rejects an invalid ruleset, its default quiet reporter leaves callers with only a generic XML validation error count. Include the existing formatted error diagnostics in RuleSetLoadException, giving callers the XML location and validation reason.

The summary prefix and XML diagnostic formatting are preserved, and warnings are excluded from the exception. Add regression coverage for one error, multiple errors, warnings, and an invalid referenced ruleset, plus a release-note entry.

Validated with Java 21 and ./mvnw -B -ntp -pl pmd-core -am clean verify: 6,468 tests, zero failures or errors, 11 skipped; Checkstyle and the other verification goals passed. All four new regression tests failed before the fix and passed afterward. The full reactor build is left to CI, following the contributor guide's module-scoped verification guidance.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests in pmd-core
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed): no new API; release notes updated

@pmd-actions-helper

pmd-actions-helper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-10-02 19:13:11+00:00 for 9a57f7f)

@UncleOwen UncleOwen 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!

@UncleOwen UncleOwen added this to the 7.29.0 milestone Oct 4, 2026
@UncleOwen
UncleOwen merged commit 7a4df9b into pmd:main Oct 4, 2026
13 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.

[core] Include XML validation details in ruleset loading errors

3 participants