You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With --auto-gen-config invalid rule references might be generated #124
The changeset contains a change to file pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/AbstractNamingConventionRule.java, which is not a rule by itself but a base class.
The regression tester however generates a ruleset like that:
[ERROR] Error at target/reports/HEAD/checkstyle/config.xml:8:5
6| <rule ref="category/apex/design.xml/CognitiveComplexity"/>
7| <rule ref="category/apex/design.xml/CyclomaticComplexity"/>
8| <rule ref="category/java/codestyle.xml/AbstractNamingConvention"/>
^^^^^ Unable to find referenced rule AbstractNamingConvention; perhaps the rule name is misspelled?
9| <rule ref="category/java/codestyle.xml/FieldNamingConventions"/>
10| <rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
[ERROR] Cannot load ruleset target/reports/HEAD/checkstyle/config.xml: An XML validation error occurred
But a rule "AbstractNamingConvention" doesn't exist...
The result is, that PMD is not executed at all and the diff report shows, that all violations are missing.
#141 actually fixed this specific bug (no invalid rule references are generated anymore). However, it created a new bug, as now the --auto-gen-config feature doesn't work anymore for rules that start with the prefix "Abstract".
I therefore consider this a different bug.
In general, I'm not reopening a bug ticket after the product has been released - as the bug is mentioned in the release notes and in the milestone etc. Rather, I'd prefer to create a new bug ticket, if the bug is not fixed against expectations or if the fix created a regression.
Activity
adangel commentedon Mar 22, 2025
Same happens for a change in AbstractCounterCheckRule in apex - the regression tester considers this a rule in the category "internal"...
Refs pmd/pmd#5617
Fix pmd#124: If an abstract rule is changed, run all rules (pmd#141)
UncleOwen commentedon Sep 21, 2025
#141 was only a partial fix
Generate ruleset for known rules
adangel commentedon Oct 9, 2025
#141 actually fixed this specific bug (no invalid rule references are generated anymore). However, it created a new bug, as now the
--auto-gen-configfeature doesn't work anymore for rules that start with the prefix "Abstract".I therefore consider this a different bug.
In general, I'm not reopening a bug ticket after the product has been released - as the bug is mentioned in the release notes and in the milestone etc. Rather, I'd prefer to create a new bug ticket, if the bug is not fixed against expectations or if the fix created a regression.
Closing this issue again.
Generate ruleset for known rules
Support `--auto-gen-config` for rules which start with "Abstract" (#142)