Skip to content

[core] Deprecate more APIs around PMD's entry point#3260

Merged
adangel merged 5 commits into
pmd:masterfrom
oowekyala:deprecate-ThreadSafeReportListener
May 27, 2021
Merged

[core] Deprecate more APIs around PMD's entry point#3260
adangel merged 5 commits into
pmd:masterfrom
oowekyala:deprecate-ThreadSafeReportListener

Conversation

@oowekyala

@oowekyala oowekyala commented May 6, 2021

Copy link
Copy Markdown
Member

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#run is deprecated in favor of PMD#runPmd.

TODO I think we should also deprecate the system properties defined in PMDCommandLineInterface: net.sourceforge.pmd.cli.noExit and net.sourceforge.pmd.cli.status. There's PMD#runPmd which doesn't call System.exit, and ideally PMD#main would always call System.exit. Clients can chose the behavior they want without system properties. Tracked by #3299 for later

I also improved the documentation for Language and LanguageVersion, because I think currently it's very subpar.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@oowekyala oowekyala added this to the 6.35.0 milestone May 6, 2021
@oowekyala oowekyala changed the title Deprecate thread safe report listener [core] Deprecate more APIs around PMD's entry point May 6, 2021
@ghost

ghost commented May 6, 2021

Copy link
Copy Markdown
1 Message
📖 This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala marked this pull request as ready for review May 24, 2021 18:19
@adangel adangel self-assigned this May 24, 2021
@oowekyala oowekyala added the is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them label May 25, 2021
@adangel adangel added the in:documentation Affects the documentation [doc] label May 27, 2021

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I'll update the release notes and also update https://pmd.github.io/latest/pmd_userdocs_tools_java_api.html accordingly when merging

Comment thread pmd-core/src/main/java/net/sourceforge/pmd/PMD.java
adangel added a commit that referenced this pull request May 27, 2021
…tener

[core] Deprecate more APIs around PMD's entry point #3260
@adangel adangel merged commit 7a4b0d2 into pmd:master May 27, 2021
@oowekyala oowekyala deleted the deprecate-ThreadSafeReportListener branch March 8, 2022 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:documentation Affects the documentation [doc] is:deprecation The main focus is deprecating public APIs or rules, eg to make them internal, or removing them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[core] Deprecate ThreadSafeReportListener

3 participants