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

Running flake8 with -quiet doesn't write a html report #9

Open
nk2017ffm opened this issue Jul 14, 2017 · 4 comments
Open

Running flake8 with -quiet doesn't write a html report #9

nk2017ffm opened this issue Jul 14, 2017 · 4 comments

Comments

@nk2017ffm
Copy link

$ pip freeze | grep -i flake8
flake8==3.3.0
flake8-html==0.4.0

$ python --version
Python 3.5.3

$ uname -a
Linux hostname 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u1 (2017-06-18) x86_64 GNU/Linux

$ cat /etc/debian_version
9.0

flake8-html doesn't write HTML reports

I hooked flake8-html into our CI and wanted to suppress output with -qq, but no reports were generated. While testing it turned out that even a single --quiet will prevent the reports from being written to disk.

What I Did

flake8 --format=html --htmldir=tmp --exit-zero --quiet

$ ls -ld tmp
ls: cannot access 'tmp': No such file or directory

@daniego
Copy link

daniego commented Dec 21, 2017

Same issue

@lordmauve
Copy link
Owner

I investigated this a little, but it seems that the handling of the --quiet option in flake8 overrides the --format option, so flake8-html isn't even invoked if --quiet is passed.

That said, it appears that there are already entry points for the --quiet mode formatters so perhaps a simple code change would allow formatter plugins to handle the --quiet option themselves.

I think it is confusing that that flake8 doesn't print an error if both --quiet and --format=html are passed on the command line, given that these options are mutually exclusive as current implemented.

@lordmauve
Copy link
Owner

Reported upstream as issue #404 (issue not found).

@chibanemourad
Copy link

I have the same issue :

flake8 calc tests --format=html --htmldir=$(FLAKE_REPORT_DIR) --exit-zero --statistics

In one of my build steps in Teamcity I run this command.
Result --> no report generated but when I run it locally I have my html report

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

No branches or pull requests

4 participants