[ADD] Flake8 configuration file

Using 'line-length=80' and flake8-bugbear's B950 warning, I respect
black's formatting of 88 columns max.

The T4 category is related to mypy lints, using the 'flake8-mypy`

The max complexity is supposed to make you write shorter functions with
less complexity, using the cyclomatic complexity heuristic.

This file is almost directly taken from black's own flake8
configuration, because I'm using it as a linter and I mostly agreed with
its settings.
This commit is contained in:
Bruno BELANYI 2019-10-08 15:31:26 +02:00
parent 558a138f2e
commit 0d04061a80
2 changed files with 23 additions and 0 deletions

flake8/.config/flake8 Normal file
View file

@ -0,0 +1,22 @@
ignore =
# Whitespace before a ':' in slices
# Line over 80 columns
# Line break before a binary operator
# Up-to 88 thanks to B950 violation
max-line-length = 80
# Cyclomatic complexity for functions
max-complexity = 18
select =
# Built-in violations (complexity, whitespace, and others)
# Violations from flake8-mypy
# Violations from flake8-bugbear, with opinionated warnings

View file

@ -5,6 +5,7 @@ stow -t ~ X
stow -t ~ bash
stow -t ~ dunst
stow -t ~ emacs
stow -t ~ flake8
stow -t ~ git
stow -t ~ i3
stow -t ~ i3blocks