blob: 10c93f8791ed94e103fb473b938ea5eb79dd585f [file] [log] [blame]
Gilles Peskine45d350b2020-12-10 23:11:59 +01001[MASTER]
2init-hook='import sys; sys.path.append("scripts")'
3
Gilles Peskine7f615752019-02-25 20:17:33 +01004[BASIC]
5# We're ok with short funtion argument names.
6# [invalid-name]
7argument-rgx=[a-z_][a-z0-9_]*$
8
9# Allow filter and map.
10# [bad-builtin]
11bad-functions=input
12
13# We prefer docstrings, but we don't require them on all functions.
14# Require them only on long functions (for some value of long).
15# [missing-docstring]
16docstring-min-length=10
17
Gilles Peskine8c8325b2021-01-26 21:13:25 +010018# No upper limit on method names. Pylint <2.1.0 has an upper limit of 30.
Gilles Peskine7f615752019-02-25 20:17:33 +010019# [invalid-name]
Gilles Peskine8c8325b2021-01-26 21:13:25 +010020method-rgx=[a-z_][a-z0-9_]{2,}$
Gilles Peskine7f615752019-02-25 20:17:33 +010021
22# Allow module names containing a dash (but no underscore or uppercase letter).
23# They are whole programs, not meant to be included by another module.
24# [invalid-name]
25module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|[a-z][-0-9a-z]+)$
26
27# Some functions don't need docstrings.
28# [missing-docstring]
Gilles Peskinea0c615e2019-02-27 11:03:43 +010029no-docstring-rgx=(run_)?main$
Gilles Peskine7f615752019-02-25 20:17:33 +010030
31# We're ok with short local or global variable names.
32# [invalid-name]
33variable-rgx=[a-z_][a-z0-9_]*$
34
35[DESIGN]
36# Allow more than the default 7 attributes.
37# [too-many-instance-attributes]
38max-attributes=15
39
40[FORMAT]
41# Allow longer modules than the default recommended maximum.
42# [too-many-lines]
43max-module-lines=2000
44
45[MESSAGES CONTROL]
Gilles Peskine17596022020-03-24 18:47:06 +010046# * locally-disabled, locally-enabled: If we disable or enable a message
47# locally, it's by design. There's no need to clutter the Pylint output
48# with this information.
Gilles Peskine46c54c02020-03-24 16:39:30 +010049# * logging-format-interpolation: Pylint warns about things like
50# ``log.info('...'.format(...))``. It insists on ``log.info('...', ...)``.
51# This is of minor utility (mainly a performance gain when there are
52# many messages that use formatting and are below the log level).
53# Some versions of Pylint (including 1.8, which is the version on
54# Ubuntu 18.04) only recognize old-style format strings using '%',
55# and complain about something like ``log.info('{}', foo)`` with
56# logging-too-many-args (Pylint supports new-style formatting if
57# declared globally with logging_format_style under [LOGGING] but
58# this requires Pylint >=2.2).
Gilles Peskine49f46792020-03-24 16:07:40 +010059# * no-else-return: Allow the perfectly reasonable idiom
60# if condition1:
61# return value1
62# else:
63# return value2
Gilles Peskine7747efc2020-03-24 18:39:50 +010064# * unnecessary-pass: If we take the trouble of adding a line with "pass",
65# it's because we think the code is clearer that way.
Gilles Peskine17596022020-03-24 18:47:06 +010066disable=locally-disabled,locally-enabled,logging-format-interpolation,no-else-return,unnecessary-pass
Gilles Peskine7f615752019-02-25 20:17:33 +010067
68[REPORTS]
69# Don't diplay statistics. Just the facts.
70reports=no
71
72[VARIABLES]
73# Allow unused variables if their name starts with an underscore.
74# [unused-argument]
75dummy-variables-rgx=_.*
Andrzej Kureka2089f52022-10-19 09:13:11 -040076
77[SIMILARITIES]
78# Ignore imports when computing similarities.
79ignore-imports=yes