Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Add CLI Progress Bar #3866

Merged
merged 12 commits into from
Apr 16, 2022

Conversation

JerritEic
Copy link

@JerritEic JerritEic commented Mar 21, 2022

Describe the PR

Adds a progress bar reporting files analyzed, number of violations and number of errors to CLI in real time. Implemented as a GlobalAnalysisListener (as suggested in #3828) and instantiated in PmdAnalysis.

Adds a small dependency, namely the progress bar utility library progressbar.

Can be toggled off using new "--no-progress" CLI argument.

Operates standalone, uses trailing carriage returns to interleave will all other output without any modifications to MessageReporter (as that class will be undergoing further changes, #3816). The logging function it uses is configurable, currently it is through System.out as it appears that the JUL to SLF4J bridge does not (yet?) properly interact with carriage returns, ignoring them completely.

Sample with interleaved output:

Interleaved.mp4

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)

@pmd-test
Copy link

pmd-test commented Mar 21, 2022

2 Messages
📖 Compared to pmd/7.0.x:
This changeset changes 16 violations,
introduces 19 new violations, 0 new errors and 0 new configuration errors,
removes 20 violations, 0 errors and 0 configuration errors.
Full report
📖 Compared to master:
This changeset changes 56919 violations,
introduces 34983 new violations, 2 new errors and 0 new configuration errors,
removes 139312 violations, 25 errors and 6 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 20 violations,
introduces 25 new violations, 0 new errors and 0 new configuration errors,
removes 21 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 56919 violations,
introduces 34988 new violations, 2 new errors and 0 new configuration errors,
removes 139312 violations, 25 errors and 6 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 16 violations,
introduces 17 new violations, 0 new errors and 0 new configuration errors,
removes 28 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 57268 violations,
introduces 34609 new violations, 7 new errors and 0 new configuration errors,
removes 138164 violations, 25 errors and 3 configuration errors.
Full report
Compared to pmd/7.0.x:
This changeset changes 108 violations,
introduces 20 new violations, 0 new errors and 0 new configuration errors,
removes 21 violations, 0 errors and 0 configuration errors.
Full report
Compared to master:
This changeset changes 57268 violations,
introduces 34616 new violations, 7 new errors and 0 new configuration errors,
removes 138164 violations, 25 errors and 3 configuration errors.
Full report

Generated by 🚫 Danger

@oowekyala oowekyala self-requested a review March 21, 2022 14:24
Copy link
Member

@oowekyala oowekyala left a comment

Choose a reason for hiding this comment

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

This is very cool, thanks a lot for contributing this!

@adangel adangel added this to the 7.0.0 milestone Mar 22, 2022
@adangel adangel changed the title [Core] Add CLI Progress Bar [core] Add CLI Progress Bar Mar 22, 2022
@adangel adangel linked an issue Mar 22, 2022 that may be closed by this pull request
@oowekyala oowekyala added this to In progress in PMD 7 via automation Mar 23, 2022
@oowekyala oowekyala self-assigned this Apr 15, 2022
@oowekyala oowekyala merged commit efd75bb into pmd:pmd/7.0.x Apr 16, 2022
PMD 7 automation moved this from In progress to Done Apr 16, 2022
adangel added a commit that referenced this pull request May 6, 2022
@adangel adangel added the in:cli Affects the PMD Command Line Interface label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:cli Affects the PMD Command Line Interface
Projects
No open projects
PMD 7
  
Done
Development

Successfully merging this pull request may close these issues.

[core] Progress reporting
5 participants