Gilles Peskine | 45d350b | 2020-12-10 23:11:59 +0100 | [diff] [blame] | 1 | [MASTER] |
| 2 | init-hook='import sys; sys.path.append("scripts")' |
| 3 | |
Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 4 | [BASIC] |
| 5 | # We're ok with short funtion argument names. |
| 6 | # [invalid-name] |
| 7 | argument-rgx=[a-z_][a-z0-9_]*$ |
| 8 | |
| 9 | # Allow filter and map. |
| 10 | # [bad-builtin] |
| 11 | bad-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] |
| 16 | docstring-min-length=10 |
| 17 | |
Gilles Peskine | 8c8325b | 2021-01-26 21:13:25 +0100 | [diff] [blame] | 18 | # No upper limit on method names. Pylint <2.1.0 has an upper limit of 30. |
Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 19 | # [invalid-name] |
Gilles Peskine | 8c8325b | 2021-01-26 21:13:25 +0100 | [diff] [blame] | 20 | method-rgx=[a-z_][a-z0-9_]{2,}$ |
Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 21 | |
| 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] |
| 25 | module-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 Peskine | a0c615e | 2019-02-27 11:03:43 +0100 | [diff] [blame] | 29 | no-docstring-rgx=(run_)?main$ |
Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 30 | |
| 31 | # We're ok with short local or global variable names. |
| 32 | # [invalid-name] |
| 33 | variable-rgx=[a-z_][a-z0-9_]*$ |
| 34 | |
| 35 | [DESIGN] |
| 36 | # Allow more than the default 7 attributes. |
| 37 | # [too-many-instance-attributes] |
| 38 | max-attributes=15 |
| 39 | |
| 40 | [FORMAT] |
| 41 | # Allow longer modules than the default recommended maximum. |
| 42 | # [too-many-lines] |
| 43 | max-module-lines=2000 |
| 44 | |
| 45 | [MESSAGES CONTROL] |
Gilles Peskine | 1759602 | 2020-03-24 18:47:06 +0100 | [diff] [blame] | 46 | # * 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 Peskine | 46c54c0 | 2020-03-24 16:39:30 +0100 | [diff] [blame] | 49 | # * 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 Peskine | 49f4679 | 2020-03-24 16:07:40 +0100 | [diff] [blame] | 59 | # * no-else-return: Allow the perfectly reasonable idiom |
| 60 | # if condition1: |
| 61 | # return value1 |
| 62 | # else: |
| 63 | # return value2 |
Gilles Peskine | 7747efc | 2020-03-24 18:39:50 +0100 | [diff] [blame] | 64 | # * 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 Peskine | 1759602 | 2020-03-24 18:47:06 +0100 | [diff] [blame] | 66 | disable=locally-disabled,locally-enabled,logging-format-interpolation,no-else-return,unnecessary-pass |
Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 67 | |
| 68 | [REPORTS] |
| 69 | # Don't diplay statistics. Just the facts. |
| 70 | reports=no |
| 71 | |
| 72 | [VARIABLES] |
| 73 | # Allow unused variables if their name starts with an underscore. |
| 74 | # [unused-argument] |
| 75 | dummy-variables-rgx=_.* |
Andrzej Kurek | a2089f5 | 2022-10-19 09:13:11 -0400 | [diff] [blame] | 76 | |
| 77 | [SIMILARITIES] |
| 78 | # Ignore imports when computing similarities. |
| 79 | ignore-imports=yes |