Skip to content

Instantly share code, notes, and snippets.

@martimors
Created March 31, 2022 08:42
Show Gist options
  • Save martimors/5ab8a80ad98b4151624798bc249ae09e to your computer and use it in GitHub Desktop.
Save martimors/5ab8a80ad98b4151624798bc249ae09e to your computer and use it in GitHub Desktop.
Sensible flake8 settings for Python
[flake8]
# Specify a list of codes to ignore.
ignore =
E203, # whitespace before ‘:’ (conflicts with black)
E501, # line too long (black will fix this)
W503, # line break before binary operator (conflicts with black)
F821, # undefined name error, (bug in pyflakes)
max-line-length = 100
max-complexity = 12
# Specify the list of error codes you wish Flake8 to report.
select =
B, # flake8 bugbear
C, # McCabe complexity errors
E, # PEP8 errors (pycodestyle)
F, # linting errors (pyflakes)
W, # PEP8 warnings (pycodestyle)
N, # pep8-naming
# ANN, # flake8-annotations, not including everything here.
ANN001, # Missing type annotation for function argument
ANN201, # Missing return type annotation for public function
A00, # flake8-builtins
U100, # unused arguments
D102,D103 # Missing docstring in public method/function
PD0, # pandas-vet, standard warnings
DAR,
unused-arguments-ignore-abstract-functions = True
# Suppress ANN200-level errors for functions that return None.
suppress-none-returning = True
# Allow some common datascience variable names.
ignore-names =
# defaults
setUp,tearDown,setUpClass,tearDownClass,asyncSetUp,asyncTearDown,setUpTestData,failureException,longMessage,maxDiff,
X,X_train,X_test
# exclude tests from flake8 checking
exclude = */tests/*
docstring_style = google
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment