[core] Deprecate more APIs around PMD's entry point#3260
Merged
adangel merged 5 commits intoMay 27, 2021
Conversation
Generated by 🚫 Danger |
adangel
approved these changes
May 27, 2021
adangel
left a comment
Member
There was a problem hiding this comment.
Thanks!
I'll update the release notes and also update https://pmd.github.io/latest/pmd_userdocs_tools_java_api.html accordingly when merging
KroArtem
reviewed
May 27, 2021
adangel
added a commit
that referenced
this pull request
May 27, 2021
adangel
added a commit
that referenced
this pull request
May 27, 2021
…tener [core] Deprecate more APIs around PMD's entry point #3260
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.
Describe the PR
Deprecate some more APIs around PMD's entry point (cf #2635), including ThreadSafeReportListener (#3196). Introduce some replacements and newer APIs, including an enum for PMD's status code (which allows for better documentation), and a way to parse CLI arguments into a configuration without using internal APIs (as suggested on gitter some time ago by @KroArtem).
The main takeaway is that
PMD#runis deprecated in favor ofPMD#runPmd.TODO I think we should also deprecate the system properties defined inTracked by #3299 for laterPMDCommandLineInterface:net.sourceforge.pmd.cli.noExitandnet.sourceforge.pmd.cli.status. There'sPMD#runPmdwhich doesn't callSystem.exit, and ideallyPMD#mainwould always callSystem.exit. Clients can chose the behavior they want without system properties.I also improved the documentation for Language and LanguageVersion, because I think currently it's very subpar.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)