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

Add option to not print skipped violations in ConsoleOutputFormatter #471

Merged
merged 3 commits into from
Feb 3, 2021

Conversation

lprzybylek
Copy link
Contributor

These changes propose a new option that allows hiding skipped violations from the console formatter's output. For depfiles with a long baseline, it is hard to spot new violations amongst skipped ones.

@smoench
Copy link
Contributor

smoench commented Feb 1, 2021

@lprzybylek thank you for your contribution. This option would also be interesting for other formatters (e.g. TableOutputFormatter). Can you add this option to the AnalyzeCommand instead? I also would prefer report-skipped as option name to keep consistency with the other names.

@lprzybylek
Copy link
Contributor Author

lprzybylek commented Feb 1, 2021

@smoench Sure. Do you think of something like this in AnalyzeCommand::execute?

        if (!$input->getOption(self::OPTION_REPORT_SKIPPED)) {
            $context = $this->getContextWithoutSkippedViolations($context);
        }

I wonder how it will affect other formatters. I'm new to this code, first time saw it on Friday, but for example baseline formatter wouldn't make much sense to be run without skipped violations. Should we handle this option in every affected formatter? Or do we assume people know what they're doing using this option?

@smoench
Copy link
Contributor

smoench commented Feb 2, 2021

No, I meant it can be implemented like AnalyzeCommand::OPTION_REPORT_UNCOVERED.
Can you add the option to the AnalyzeCommand and adjust the ConsoleOutputFormatter? I will adjust the other output formatters.

@smoench smoench merged commit 57e50c7 into qossmic:master Feb 3, 2021
@smoench
Copy link
Contributor

smoench commented Feb 3, 2021

Thank you @lprzybylek!

@lprzybylek lprzybylek deleted the do-not-print-skipped-violations branch February 3, 2021 08:14
@smoench smoench modified the milestones: 0.12.0, 0.11.1 Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants