blob: 9cfc4d375789aeeed870a3cfa957993bbf3c50f1 [file] [log] [blame]
Alex Deymobae90be2017-03-17 00:30:28 -07001# Copyright 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15[MASTER]
16
17# Specify a configuration file.
18#rcfile=
19
20# Python code to execute, usually for sys.path manipulation such as
21# pygtk.require().
22#init-hook=
23
24# Profiled execution.
25profile=no
26
Andrewcc6ab9f2020-06-25 07:41:40 -070027# Add files or directories to the ignorelist. They should be base names, not
Alex Deymobae90be2017-03-17 00:30:28 -070028# paths.
Sen Jiang1b54e702018-11-14 16:20:58 -080029ignore=CVS,.svn,.git,update_metadata_pb2.py
Alex Deymobae90be2017-03-17 00:30:28 -070030
31# Pickle collected data for later comparisons.
32persistent=yes
33
34# List of plugins (as comma separated values of python modules names) to load,
35# usually to register additional checkers.
36load-plugins=
37
38# Use multiple processes to speed up Pylint.
39jobs=1
40
41# Allow loading of arbitrary C extensions. Extensions are imported into the
42# active Python interpreter and may run arbitrary code.
43unsafe-load-any-extension=no
44
Alex Deymobae90be2017-03-17 00:30:28 -070045# Allow optimization of some AST trees. This will activate a peephole AST
46# optimizer, which will apply various small optimizations. For instance, it can
47# be used to obtain the result of joining multiple strings with the addition
48# operator. Joining a lot of strings can lead to a maximum recursion error in
49# Pylint and this flag can prevent that. It has one side effect, the resulting
50# AST will be different than the one from reality.
51optimize-ast=no
52
53
54[MESSAGES CONTROL]
55
56# List of checkers and warnings to enable.
57enable=old-raise-syntax
58
59# Only show warnings with the listed confidence levels. Leave empty to show
60# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
61confidence=
62
63# Enable the message, report, category or checker with the given id(s). You can
64# either give multiple identifier separated by comma (,) or put this option
65# multiple time. See also the "--disable" option for examples.
66#enable=
67
68# Disable the message, report, category or checker with the given id(s). You
69# can either give multiple identifiers separated by comma (,) or put this
70# option multiple times (only on the command line, not in the configuration
71# file where it should appear only once).You can also use "--disable=all" to
72# disable everything first and then reenable specific checks. For example, if
73# you want to run only the similarities checker, you can use "--disable=all
74# --enable=similarities". If you want to run only the classes checker, but have
75# no Warning level messages displayed, use"--disable=all --enable=classes
76# --disable=W"
77# We leave many of the style warnings to judgement/peer review.
78disable=
79 fixme,
80 locally-disabled,
81 locally-enabled,
82 no-self-use,
83 star-args,
84 too-few-public-methods,
85 too-many-arguments,
86 too-many-branches,
87 too-many-instance-attributes,
88 too-many-lines,
89 too-many-locals,
90 too-many-public-methods,
91 too-many-return-statements,
92 too-many-statements,
93
94
95[REPORTS]
96
97# Set the output format. Available formats are text, parseable, colorized, msvs
98# (visual studio) and html. You can also give a reporter class, eg
99# mypackage.mymodule.MyReporterClass.
100output-format=text
101
102# Put messages in a separate file for each module / package specified on the
103# command line instead of printing them on stdout. Reports (if any) will be
104# written in a file name "pylint_global.[txt|html]".
105files-output=no
106
107# Tells whether to display a full report or only the messages
108reports=no
109
110# Python expression which should return a note less than 10 (10 is the highest
111# note). You have access to the variables errors warning, statement which
112# respectively contain the number of errors / warnings messages and the total
113# number of statements analyzed. This is used by the global evaluation report
114# (RP0004).
115#evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
116
117# Template used to display messages. This is a python new-style format string
118# used to format the message information. See doc for all details
119#msg-template=
120
121
122[SIMILARITIES]
123
124# Minimum lines number of a similarity.
125min-similarity-lines=20
126
127# Ignore comments when computing similarities.
128ignore-comments=yes
129
130# Ignore docstrings when computing similarities.
131ignore-docstrings=yes
132
133# Ignore imports when computing similarities.
134ignore-imports=no
135
136
137[TYPECHECK]
138
139# Tells whether missing members accessed in mixin class should be ignored. A
140# mixin class is detected if its name ends with "mixin" (case insensitive).
141ignore-mixin-members=yes
142
143# List of module names for which member attributes should not be checked
144# (useful for modules/projects where namespaces are manipulated during runtime
145# and thus existing member attributes cannot be deduced by static analysis. It
146# supports qualified module names, as well as Unix pattern matching.
Sen Jiangc2527f42017-09-27 16:35:03 -0700147ignored-modules=update_payload.update_metadata_pb2
Alex Deymobae90be2017-03-17 00:30:28 -0700148
149# List of classes names for which member attributes should not be checked
150# (useful for classes with attributes dynamically set). This supports can work
151# with qualified names.
152ignored-classes=hashlib,numpy
153
154# List of members which are set dynamically and missed by pylint inference
155# system, and so shouldn't trigger E1101 when accessed. Python regular
156# expressions are accepted.
157generated-members=
158
159# List of decorators that create context managers from functions, such as
160# contextlib.contextmanager.
161contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
162
163
164[SPELLING]
165
166# Spelling dictionary name. Available dictionaries: none. To make it working
167# install python-enchant package.
168spelling-dict=
169
170# List of comma separated words that should not be checked.
171spelling-ignore-words=
172
173# A path to a file that contains private dictionary; one word per line.
174spelling-private-dict-file=
175
176# Tells whether to store unknown words to indicated private dictionary in
177# --spelling-private-dict-file option instead of raising a message.
178spelling-store-unknown-words=no
179
180
181[LOGGING]
182
183# Logging modules to check that the string format arguments are in logging
184# function parameter format
185logging-modules=logging
186
187
188[VARIABLES]
189
190# Tells whether we should check for unused import in __init__ files.
191init-import=no
192
193# A regular expression matching names used for dummy variables (i.e. not used).
194dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
195
196# List of additional names supposed to be defined in builtins. Remember that
197# you should avoid to define new builtins when possible.
198additional-builtins=
199
200# List of strings which can identify a callback function by name. A callback
201# name must start or end with one of those strings.
202callbacks=cb_,_cb
203
204
205[FORMAT]
206
207# Maximum number of characters on a single line.
208max-line-length=80
209
210# Allow the body of an if to be on the same line as the test if there is no
211# else.
212single-line-if-stmt=no
213
214# Regexp for a line that is allowed to be longer than the limit.
215# This "ignore" regex is today composed of 4 independent parts:
216# (1) Long import lines
217# (2) URLs in comments or pydocs. Detecting URLs by regex is a hard problem and
218# no amount of tweaking will make a perfect regex AFAICT. This one is a good
219# compromise.
220# (3) Constant string literals at the start of files don't need to be broken
221# across lines. Allowing long paths, streamz and urls to be on a single
222# line. Also requires that the string not be a triplequoted string.
223ignore-long-lines=(?x)
224 (^\s*(import|from)\s
225 |^\s*(\#\ )?<?(https?|ftp):\/\/[^\s\/$.?#].[^\s]*>?$
226 |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+')
227 )
228
229# Maximum number of lines in a module
230max-module-lines=99999
231
232# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
233# tab).
234indent-string=' '
235
236# Number of spaces of indent required inside a hanging or continued line.
237indent-after-paren=4
238
239# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
240expected-line-ending-format=LF
241
242# Make sure : in dicts and trailing commas are checked for whitespace.
243no-space-check=
244
245
246[MISCELLANEOUS]
247
248# List of note tags to take in consideration, separated by a comma.
249notes=FIXME,XXX,TODO
250
251
252[BASIC]
253
254# Required attributes for module, separated by a comma
255required-attributes=
256
257# List of builtins function names that should not be used, separated by a comma
258bad-functions=map,filter,input,apply,reduce
259
260# Good variable names which should always be accepted, separated by a comma
Sen Jiang10485592017-08-15 18:20:24 -0700261good-names=i,j,k,ex,x,_,main
Alex Deymobae90be2017-03-17 00:30:28 -0700262
263# Bad variable names which should always be refused, separated by a comma
264bad-names=foo,bar,baz,toto,tutu,tata
265
266# Colon-delimited sets of names that determine each other's naming style when
267# the name regexes allow several styles.
268name-group=
269
270# Include a hint for the correct naming format with invalid-name
271include-naming-hint=no
272
273# Regular expression which should only match correct function names.
274# 'camel_case' and 'snake_case' group names are used for consistency of naming
275# styles across functions and methods.
276function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
277
278# Naming hint for function names
279function-name-hint=[a-z_][a-z0-9_]{2,30}$
280
281# Regular expression which should only match correct variable names
282variable-rgx=^[a-z][a-z0-9_]*$
283
284# Naming hint for variable names
285variable-name-hint=[a-z_][a-z0-9_]{2,30}$
286
287# Regular expression which should only match correct module level names
288const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
289
290# Naming hint for constant names
291const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
292
293# Regular expression which should only match correct instance attribute names
294attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
295
296# Naming hint for attribute names
297attr-name-hint=[a-z_][a-z0-9_]{2,30}$
298
299# Regular expression which should only match correct argument names
300argument-rgx=^[a-z][a-z0-9_]*$
301
302# Naming hint for argument names
303argument-name-hint=[a-z_][a-z0-9_]{2,30}$
304
305# Regular expression which should only match correct class attribute
306class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
307
308# Naming hint for class attribute names
309class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
310
311# Regular expression which should only match correct list comprehension /
312# generator expression variable names
313inlinevar-rgx=^[a-z][a-z0-9_]*$
314
315# Naming hint for inline iteration names
316inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
317
318# Regular expression which should only match correct class names
319class-rgx=^_?[A-Z][a-zA-Z0-9]*$
320
321# Naming hint for class names
322class-name-hint=[A-Z_][a-zA-Z0-9]+$
323
324# Regular expression which should only match correct module names. The
325# leading underscore is sanctioned for private modules by Google's style
326# guide.
327module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$
328
329# Naming hint for module names
330module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
331
332# Regular expression which should only match correct method names.
333# 'camel_case' and 'snake_case' group names are used for consistency of naming
334# styles across functions and methods. 'exempt' indicates a name which is
335# consistent with all naming styles.
336method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
337
338# Naming hint for method names
339method-name-hint=[a-z_][a-z0-9_]{2,30}$
340
341# Regular expression which should only match function or class names that do
342# not require a docstring.
343no-docstring-rgx=(__.*__|main)
344
345# Minimum line length for functions/classes that require docstrings, shorter
346# ones are exempt.
347docstring-min-length=10
348
349# List of decorators that define properties, such as abc.abstractproperty.
350property-classes=abc.abstractproperty
351
352
353[ELIF]
354
355# Maximum number of nested blocks for function / method body
356max-nested-blocks=5
357
358
359[DESIGN]
360
361# Maximum number of arguments for function / method
362max-args=5
363
364# Argument names that match this expression will be ignored. Default to name
365# with leading underscore
366ignored-argument-names=_.*
367
368# Maximum number of locals for function / method body
369max-locals=15
370
371# Maximum number of return / yield for function / method body
372max-returns=6
373
374# Maximum number of branch for function / method body
375max-branches=12
376
377# Maximum number of statements in function / method body
378max-statements=50
379
380# Maximum number of parents for a class (see R0901).
381max-parents=10
382
383# Maximum number of attributes for a class (see R0902).
384max-attributes=7
385
386# Minimum number of public methods for a class (see R0903).
387min-public-methods=2
388
389# Maximum number of public methods for a class (see R0904).
390max-public-methods=20
391
392# Maximum number of boolean expressions in a if statement
393max-bool-expr=5
394
395
396[CLASSES]
397
398# List of method names used to declare (i.e. assign) instance attributes.
399defining-attr-methods=__init__,__new__,setUp
400
401# List of valid names for the first argument in a class method.
402valid-classmethod-first-arg=cls
403
404# List of valid names for the first argument in a metaclass class method.
405valid-metaclass-classmethod-first-arg=mcs
406
407# List of member names, which should be excluded from the protected access
408# warning.
409exclude-protected=_asdict,_fields,_replace,_source,_make
410
411
412[IMPORTS]
413
414# Deprecated modules which should not be used, separated by a comma
415deprecated-modules=regsub,TERMIOS,Bastion,rexec,optparse
416
417# Create a graph of every (i.e. internal and external) dependencies in the
418# given file (report RP0402 must not be disabled)
419import-graph=
420
421# Create a graph of external dependencies in the given file (report RP0402 must
422# not be disabled)
423ext-import-graph=
424
425# Create a graph of internal dependencies in the given file (report RP0402 must
426# not be disabled)
427int-import-graph=
428
429
430[EXCEPTIONS]
431
432# Exceptions that will emit a warning when being caught. Defaults to
433# "Exception"
434overgeneral-exceptions=StandardError,Exception,BaseException