You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users of flake8-html, a HTML report plugin for flake8, reported that passing the --quiet option to flake8 causes it not to generate the expected HTML output. This is flake8-html issue #9.
flake8-html is invoked as a report plugin for flake8. For example, a command-line might be
flake8 --format=html --htmldir=flake8-report/
Because this produces HTML output containing full details, it produces much more terse console output such as
./demo_game.py has issues: high: 26 medium: 1
./doc/conf.py has issues: medium: 1
Users are expecting that they can suppress this output, while receiving HTML reports, by writing command-lines such as
It would avoid user confusion if passing both --quiet and --format parameters exited with an error. This would make it clear to users that this combination is not currently supported, but it doesn't achieve what users were trying to achieve by using --format=html with --quiet.
The handling of the '--quiet'/'-q'/'-qq' etc could be delegated to the formatter. This could be done in a backwards-compatible way so that plugins that the existing behaviour is preserved for plugins that do not implement this, or in such a way that passing --quiet when the selected report plugin does not support it produces an error.
The text was updated successfully, but these errors were encountered:
I'd be interested to see a merge request for the second suggested solution. I think that may be the best way to handle this but I'm struggling to see a way that preserves backwards compatibility.
In GitLab by @lordmauve on Feb 5, 2018, 11:29
Issue
Users of flake8-html, a HTML report plugin for flake8, reported that passing the
--quiet
option to flake8 causes it not to generate the expected HTML output. This is flake8-html issue #9.flake8-html
is invoked as a report plugin for flake8. For example, a command-line might beBecause this produces HTML output containing full details, it produces much more terse console output such as
Users are expecting that they can suppress this output, while receiving HTML reports, by writing command-lines such as
However, no HTML reports are written in this case.
Version
I confirmed this as of
flake8==3.5.0
.Root cause
From investigating the source code for flake8, I believe the issue is that the --quiet option overrides the --format parameter in
Application.make_formatter()
.When
--quiet
is passed,--format
is ignored.Possible solutions
--quiet
and--format
parameters exited with an error. This would make it clear to users that this combination is not currently supported, but it doesn't achieve what users were trying to achieve by using--format=html
with--quiet
.--quiet
when the selected report plugin does not support it produces an error.The text was updated successfully, but these errors were encountered: