lordmauve / flake8-html

Generate HTML reports of flake8 violations
Other
52 stars 17 forks source link

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

Open nk2017ffm opened 7 years ago

nk2017ffm commented 7 years ago

$ 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 commented 6 years ago

Same issue

lordmauve commented 6 years ago

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 commented 6 years ago

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

chibanemourad commented 5 years ago

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