[core] New RuleSet API and deprecations for PMD's entry point APIs#2635
Conversation
Deprecate compatibility filter Deprecate methods in RulesetsFactUtils
51e8a43 to
125b020
Compare
Generated by 🚫 Danger |
| * | ||
| * @throws RuntimeException If processing fails | ||
| */ | ||
| public static void processFiles(final PMDConfiguration configuration, |
There was a problem hiding this comment.
Should we mark this as experimental? Or would we just deprecate this as well, if we have a better PMD programmatic API?
There was a problem hiding this comment.
It may be possible to preserve compatibility with this signature in PMD 7. But also I think we should ideally keep a published entry point, that remains non-deprecated in the 6.x release cycle
|
I've checked both maven-pmd-plugin and eclipse-pmd-plugin with these changes. They compile without changes, so there are no compatibility issues. I've tried to resolve deprecations for m-pmd-p, which is not much: adangel/maven-pmd-plugin@008f771 I didn't try to update eclipse-pmd-plugin to resolve deprecations, but the tests still run successful. |
I think this will be more compatible with pmd 7.
|
Should we keep I believe it would be nicer to create an unchecked |
Report was being rendered mutliple times
[core] New RuleSet API and deprecations for PMD's entry point APIs #2635
|
@oowekyala I'm trying to merge this now into pmd/7.0.x .... |
Describe the PR
So this replaces RuleSetFactory/RuleSetFactoryUtils with a single
RuleSetParserRuleSetLoader class. This replaces the complicated overloads ofcreateFactoryin RulesetFactoryUtils, and the constructors. This is more readable and lends itself to future extensions easily.Background: I want to improve the error messages of RulesetFactory for PMD 7 (like, report something more helpful than an IllegalArgumentException stack trace), and those constructors/factory methods are too rigid to be modified.
RuleSetFactory can be internalized as the implementation of RuleSetParser (like
RuleFactoryis already), which is nice for the 7.0 schema update.Also add new APIs where needed to make the entry point (PMD#processFiles) not rely on RuleSetFactory, nor on RuleSets. This is an ok transitional API I think.
Many other classes have been deprecated as internal, for example, AbstractPmdProcessor, SourceCodeProcessor, or PMDCommandLineInterface.
Ready?
./mvnw clean verifypasses (checked automatically by travis)