/
.flake8
65 lines (57 loc) · 1.83 KB
/
.flake8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
[flake8]
exclude =
.git,
__pycache__,
auto_examples,
build,
dist,
env,
nilearn/externals/tempita,
nilearn/externals/,
nilearn_cache,
nilearn/_version.py,
venv,
doc/_build
docstring-convention = numpy
max-line-length = 79
max_complexity = 43
max_function_length = 407
max_parameters_amount = 27
max_returns_amount = 10
# ----------------------- errors to include / exclude -----------------------
# See https://flake8.pycqa.org/en/latest/user/violations.html#selecting-violations-with-flake8
# For PEP8 error codes see:
# http://pep8.readthedocs.org/en/latest/intro.html#error-codes
#
# The ruff website also has a very didactic explanations on the reasons
# why those rules exist:
# https://docs.astral.sh/ruff/rules/
# Non-exhaustive listing:
#
# B: flake8 bugbear errors
# CFQ: flake8 functions errors
# D: pydocstyle
# D100-D104: missing docstring
# D105: missing docstring in magic method
# D107: missing docstring in __init__
# D205: 1 blank line required between summary line and description
# D400: first line should end with a period
# E: errors
# E203 whitespace before ':'
# is for compatibility with black
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
# E402: module level import not at top of file
# F401: module imported but unused
# W: warnings
# W503: line break before binary operator
# W504: line break after binary operator
--select = B,D,E,F,W,C90,CFQ
per-file-ignores =
**/__init__.py: D104
# - docstrings rules that should not be applied to tests
**/tests/*: D100, D101, D102, D103
# - docstrings rules that should not be applied to examples
examples/*/*: D103, D205, D301, D400
# - docstrings rules that should not be applied to doc
doc/*: D103, F401
extend-ignore = B026, B028, CFQ003, D105, D107, E203, E402, W503, W504, W605