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