| Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 1 | [BASIC] | 
|  | 2 | # We're ok with short funtion argument names. | 
|  | 3 | # [invalid-name] | 
|  | 4 | argument-rgx=[a-z_][a-z0-9_]*$ | 
|  | 5 |  | 
|  | 6 | # Allow filter and map. | 
|  | 7 | # [bad-builtin] | 
|  | 8 | bad-functions=input | 
|  | 9 |  | 
|  | 10 | # We prefer docstrings, but we don't require them on all functions. | 
|  | 11 | # Require them only on long functions (for some value of long). | 
|  | 12 | # [missing-docstring] | 
|  | 13 | docstring-min-length=10 | 
|  | 14 |  | 
|  | 15 | # Allow longer methods than the default. | 
|  | 16 | # [invalid-name] | 
|  | 17 | method-rgx=[a-z_][a-z0-9_]{2,35}$ | 
|  | 18 |  | 
|  | 19 | # Allow module names containing a dash (but no underscore or uppercase letter). | 
|  | 20 | # They are whole programs, not meant to be included by another module. | 
|  | 21 | # [invalid-name] | 
|  | 22 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|[a-z][-0-9a-z]+)$ | 
|  | 23 |  | 
|  | 24 | # Some functions don't need docstrings. | 
|  | 25 | # [missing-docstring] | 
| Gilles Peskine | a0c615e | 2019-02-27 11:03:43 +0100 | [diff] [blame] | 26 | no-docstring-rgx=(run_)?main$ | 
| Gilles Peskine | 7f61575 | 2019-02-25 20:17:33 +0100 | [diff] [blame] | 27 |  | 
|  | 28 | # We're ok with short local or global variable names. | 
|  | 29 | # [invalid-name] | 
|  | 30 | variable-rgx=[a-z_][a-z0-9_]*$ | 
|  | 31 |  | 
|  | 32 | [DESIGN] | 
|  | 33 | # Allow more than the default 7 attributes. | 
|  | 34 | # [too-many-instance-attributes] | 
|  | 35 | max-attributes=15 | 
|  | 36 |  | 
|  | 37 | [FORMAT] | 
|  | 38 | # Allow longer modules than the default recommended maximum. | 
|  | 39 | # [too-many-lines] | 
|  | 40 | max-module-lines=2000 | 
|  | 41 |  | 
|  | 42 | [MESSAGES CONTROL] | 
| Gilles Peskine | 1759602 | 2020-03-24 18:47:06 +0100 | [diff] [blame] | 43 | # * locally-disabled, locally-enabled: If we disable or enable a message | 
|  | 44 | #   locally, it's by design. There's no need to clutter the Pylint output | 
|  | 45 | #   with this information. | 
| Gilles Peskine | 46c54c0 | 2020-03-24 16:39:30 +0100 | [diff] [blame] | 46 | # * logging-format-interpolation: Pylint warns about things like | 
|  | 47 | #   ``log.info('...'.format(...))``. It insists on ``log.info('...', ...)``. | 
|  | 48 | #   This is of minor utility (mainly a performance gain when there are | 
|  | 49 | #   many messages that use formatting and are below the log level). | 
|  | 50 | #   Some versions of Pylint (including 1.8, which is the version on | 
|  | 51 | #   Ubuntu 18.04) only recognize old-style format strings using '%', | 
|  | 52 | #   and complain about something like ``log.info('{}', foo)`` with | 
|  | 53 | #   logging-too-many-args (Pylint supports new-style formatting if | 
|  | 54 | #   declared globally with logging_format_style under [LOGGING] but | 
|  | 55 | #   this requires Pylint >=2.2). | 
| Gilles Peskine | 49f4679 | 2020-03-24 16:07:40 +0100 | [diff] [blame] | 56 | # * no-else-return: Allow the perfectly reasonable idiom | 
|  | 57 | #    if condition1: | 
|  | 58 | #        return value1 | 
|  | 59 | #    else: | 
|  | 60 | #        return value2 | 
| Gilles Peskine | 7747efc | 2020-03-24 18:39:50 +0100 | [diff] [blame] | 61 | # * unnecessary-pass: If we take the trouble of adding a line with "pass", | 
|  | 62 | #   it's because we think the code is clearer that way. | 
| Gilles Peskine | 1759602 | 2020-03-24 18:47:06 +0100 | [diff] [blame] | 63 | 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] | 64 |  | 
|  | 65 | [REPORTS] | 
|  | 66 | # Don't diplay statistics. Just the facts. | 
|  | 67 | reports=no | 
|  | 68 |  | 
|  | 69 | [VARIABLES] | 
|  | 70 | # Allow unused variables if their name starts with an underscore. | 
|  | 71 | # [unused-argument] | 
|  | 72 | dummy-variables-rgx=_.* |