Custom formatter for flake8 violations.

Tries to be beatiful, compact, and informative. Improves the default formatter used by flake8.


To activate this formatter one will need to run:

flake8 --format=wemake

Or set the configuration option inside setup.cfg file:

format = wemake

Option format = wemake is included into our default configuration.

To switch back to the default flake8 formatter, you can use format = default option.

There are other formatters out there as well. They can be installed as plugins.

Showing source code

You can also (and we recommend to) enable --show-source option. It can be passed as a command line argument or set in setup.cfg:

show-source = True

It will change how your reports are formatted, and will show the exact problem with your code:

» flake8 . --format=wemake --show-source


  E231  120:32   missing whitespace after ':'
  def show_source(self, error:Violation) -> str:

It helps to visially identify the problems in your code and fix it faster. We include show-source = True into our default configuration.

Showing statistic

You can also show the statitics about problems inside your code.

It will group all violations by type and tell how many of them do you have and where you have them:

» flake8 . --format=wemake --show-source --statistic


  E231  136:32   missing whitespace after ':'
  def show_source(self, error:Violation) -> str:


  E231  52:47    missing whitespace after ','
  AnyFunctionDefAndLambda = Union[AnyFunctionDef,ast.Lambda]

E231: missing whitespace after ':'
  1     ./wemake_python_styleguide/
  1     ./wemake_python_styleguide/
Total: 2

All errors: 2

We do not include show-statistic in our default configuration. It should be only called when user needs to find how many violations there are and what files do contain them.