GeezerVison is showing github.com — [core] PMD should display number of rules violated or errors found · Issue #1995 · pmd/pmd
[core] PMD should display number of rules violated or errors found #1995DescriptionAffects PMD Version:
6.17
Rule:
All rulesets.
Description:
PMD output does not inform the user as to the number of rules contravened while running the tool. The user has to look at the output file.
Code Sample demonstrating the issue:
Sep 01, 2019 9:42:45 AM net.sourceforge.pmd.cache.FileAnalysisCache loadFromFile
INFO: Analysis cache loaded
Sep 01, 2019 9:43:02 AM net.sourceforge.pmd.cache.AbstractAnalysisCache checkValidity
INFO: Analysis cache invalidated, execution classpath changed.
Sep 01, 2019 9:43:07 AM net.sourceforge.pmd.cache.FileAnalysisCache persist
INFO: Analysis cache updated
Running PMD through:
[CLI | Ant] Activitychanged the title [-][java] PMD must display number of rules contravened or errors found. [/-] [+][core] PMD must display number of rules contravened or errors found[/+] on Sep 2, 2019agkanos commented on Sep 28, 2019 linusjf commented on Oct 8, 2019 Author show commentMore actions linusjf commented on Oct 8, 2019 Author show commentMore actions adangel commented on Oct 8, 2019 linusjf commented on Oct 8, 2019 Author show commentMore actions linusjf commented on Oct 8, 2019 Author show commentMore actions linusjf commented on Oct 9, 2019 Author show commentMore actions linusjf commented on Oct 9, 2019 Author show commentMore actions oowekyala commented on Oct 9, 2019 linusjf commented on Oct 9, 2019 No intention to parse the output, as yet.
The original request was to display the number of errors.
My mistake about the shell error codes. A glaring one. agkanos commented on Oct 9, 2019 Hey guys sorry for taking so long to come back on this. I can see a similar implementation that already exists here. This is triggered by passing the flag: -f textcolor . What exactly are we looking from this enhancement?
Ok I missed the: while running the tool oowekyala commented on Oct 9, 2019 @ThanasisGkanos Tbh even with while running the tool I think the question is very vague. If it was the case that OP's looking for a progress indicator, then changing the exit code would have been pointless.
@Fernal73 Why do you want to read the number of rules? Do you need to parse it or do you just think it would be useful info for an end-user? Are you asking for a progress indicator during the run, or just a summary line at the end? What renderer are you using? Reacted by Athanasios Gkanos and Linus Fernandes 04Deek commented on Apr 29, 2022 changed the title [-][core] PMD must display number of rules contravened or errors found[/-] [+][core] PMD must display number of rules violated or errors found[/+] on Apr 29, 2022changed the title [-][core] PMD must display number of rules violated or errors found[/-] [+][core] PMD should display number of rules violated or errors found[/+] on Apr 29, 2022adangel commented on Apr 29, 2022 Ok, I went through all the comments and hid all that were off topic.
The task here is as follows:
When you run PMD on the command line (see https://pmd.github.io/latest/pmd_userdocs_cli_reference.html), PMD just executes and terminates when it has finished. There is no visual output at all to tell the user e.g. "Found 11 violations. And there were 2 processing errors.".
Or in case, no problems have been detected, the output could be something like "Found no violations.".
Especially there is no output, if you write the report to a file (--report-file).
See also https://github.com/pmd/pmd/wiki/Newcomers%27-Guide Reacted by 04Deek and Xiaohui abhinavashok commented on Dec 13, 2023 Is anyone working on this ? adangel commented on Dec 14, 2023 xiao-hui-ux commented on Oct 1, 2024 Hi, I would want to work on this issue. DragonFSKY commented on Jun 28, 2026 I don't see an active PR or assignee for this. I'm preparing a small CLI-only implementation that prints the existing violation/processing-error counts through the CLI reporter without changing report output or exit codes. Happy to defer if someone is actively working on it.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|