-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtox.ini
40 lines (40 loc) · 1.42 KB
/
tox.ini
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
# Tell flake8 not to check some things.
# Ref. https://pycodestyle.pycqa.org/en/latest/intro.html#configuration
# Ref. https://flake8.pycqa.org/en/latest/user/configuration.html
# Ref. https://github.com/PyCQA/pycodestyle
# Ref. https://pylint.readthedocs.io/en/latest/user_guide/options.html
#
# Rationale:
#
# • McCabe complexity of 10 was chosen arbitrarily.
# It is a warning for functions that are way too big.
#
# • 132 is the traditional "wide terminal" size (cf. 80).
# We use it because JUDICIOUS use of long lines is better than
# peppering the codebase with arbitrary line breaks.
#
# MOST lines should still wrap at 79.
#
# • We ignore E129 because the alternatives are all about as horrible.
# Ref. https://github.com/PyCQA/pycodestyle/issues/386
# Ref. https://stackoverflow.com/questions/181530/python-style-multiple-line-conditions-in-ifs
#
# • UPDATE 2023: ignoring "W504 line break after binary operator", because
# very often there's a long string like
#
# if ((p and
# q and
# r) or
# (s and not t)):
# do_thing
#
# And when p/q/r/s/t are all long, there
# is really no nicer way to break that up.
#
# Also, I think I don't normally have operator-newline sequences WITHOUT good justification.
#
# Also, Adding "noqa: W504" to all those lines would make them super annoying to read.
[flake8]
max-line-length = 131
ignore = E129,W504
max-complexity = 10