Formatters¶
Formatters make errors output nice. Available formatters:
colored– for humans.gitlab– Gitlab CI Code Quality artifact.grouped– also colored, but all messages are explicitly grouped by file.json– no colors, only one json-dict per line for every error.stat– show errors count for every code, grouped by plugins.default– classic Flake8 formatter. Booooring.
Also, you can specify show_source = true in the config to show line of source code where error occurred with syntax highlighting.
Colored with source code¶
[tool.flakehell]
format = "colored"
show_source = true
output of colored formatter with source code
Grouped with source code¶
[tool.flakehell]
format = "grouped"
show_source = true
output of grouped formatter with source code
Gitlab¶
Output Code Quality artifact compatible with Gitlab CI.
[tool.flakehell]
format = "gitlab"
An example of Gitlab CI job (.gitlab-ci.yml):
flakehell:
image: python:3.7
script:
- pip3 install flakehell
- flakehell lint --format=gitlab --output-file flakehell.json
artifacts:
reports:
codequality: flakehell.json
output of colored formatter
output of grouped formatter
output of stat formatter
output of json formatter