Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With --auto-gen-config invalid rule references might be generated #124

Open
adangel opened this issue Apr 25, 2024 · 0 comments
Open

With --auto-gen-config invalid rule references might be generated #124

adangel opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@adangel
Copy link
Member

adangel commented Apr 25, 2024

See pmd/pmd#4971 for an example:

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.

@adangel adangel added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant