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"

output of colored formatter

Colored with source code

[tool.flakeheaven]
format = "colored"
show_source = true

output of colored formatter with source code

Grouped

[tool.flakeheaven]
format = "grouped"

output of grouped formatter

Grouped with source code

[tool.flakeheaven]
format = "grouped"
show_source = true

output of grouped formatter with source code

Stat

[tool.flakeheaven]
format = "stat"

output of stat formatter

JSON

[tool.flakeheaven]
format = "json"

output of json formatter

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