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