Repository navigation
Support --auto-gen-config for rules which start with "Abstract" - #142
Merged
Merged
Conversation
With the previous fix for pmd#124, if a rule named "Abstract..." has been changed, we would create a regression report for all rules. This PR now changes the implementation to create a list of all rules with there java source file name.
This should make the build a tiny bit faster.
adangel
force-pushed
the
dynamic-ruleset-with-abstract
branch
from
October 10, 2025 10:49
df49d2f to
b5c89c6
Compare
We need to compile tests, as pmd-ant is depending on the test artifacts from pmd-core... This reverts commit 9cb700b.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This solves #124 slightly differently: As we know, which rules exist, we use that information and build up a map of rule java source files to rule references. E.g. in pmd-java/src/main/categories/java/bestpractices.xml we see, that the rule "AbstractClassWithoutAbstractMethod" is implemented in class "net.sourceforge.pmd.lang.java.rule.bestpractices.AbstractClassWithoutAbstractMethodRule". For this class name we can guess the corresponding java source (.../src/main/java/...). So, when we see this java source in the changes, then we know, we need to regression test that rule.
This means, we don't guess anymore, whether a java source file is a rule implementation - we have a list of all rule implementations that we can check now.
This also fixes the integration test (https://github.com/pmd/pmd-regression-tester/actions/workflows/manual-integration-tests.yml): In test case 1 we changed the rule AbstractClassWithoutAbstractMethod and we expect, that we only see differences from this rule. As other rules won't be executed, we expected that we get less errors - but with the change from #141 now all rules have been executed again.
Refs
--auto-gen-configinvalid rule references might be generated #124