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¶
[tool.flakeheaven]
format = "colored"
Colored with source code¶
[tool.flakeheaven]
format = "colored"
show_source = true
Grouped¶
[tool.flakeheaven]
format = "grouped"
Grouped with source code¶
[tool.flakeheaven]
format = "grouped"
show_source = true
Stat¶
[tool.flakeheaven]
format = "stat"
JSON¶
[tool.flakeheaven]
format = "json"
Gitlab¶
Output Code Quality artifact compatible with Gitlab CI.
[tool.flakeheaven]
format = "gitlab"
An example of Gitlab CI job (.gitlab-ci.yml
):
flakeheaven:
image: python:3.7
script:
- pip3 install flakeheaven
- flakeheaven lint --format=gitlab --output-file flakeheaven.json
artifacts:
reports:
codequality: flakeheaven.json