Skip to content

Conversation

@adangel
Copy link
Member

@adangel adangel commented Oct 9, 2025

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

@adangel adangel added this to the next milestone Oct 9, 2025
@adangel adangel added the bug Something isn't working label Oct 9, 2025
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 adangel force-pushed the dynamic-ruleset-with-abstract branch from df49d2f to b5c89c6 Compare October 10, 2025 10:49
We need to compile tests, as pmd-ant is depending on the test artifacts from pmd-core...

This reverts commit 9cb700b.
@adangel adangel merged commit 5b4294b into pmd:main Oct 23, 2025
1 check passed
@adangel adangel deleted the dynamic-ruleset-with-abstract branch October 23, 2025 14:38
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

Successfully merging this pull request may close these issues.

1 participant