blob: f26c84adce0b04e5d019f0e94390952ea4d060bc [file] [log] [blame]
kjellander38c65c82017-04-13 05:43:381# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9# This file is mostly based on the contents of
10# https://cs.chromium.org/chromium/tools/depot_tools/pylintrc
11# and (since the above doesn't properly support naming style checks)
12# https://cs.chromium.org/chromium/src/third_party/chromite/pylintrc
13
Henrik Kjellander57e5fd22015-05-25 10:55:3914[MESSAGES CONTROL]
15
16# Disable the message, report, category or checker with the given id(s).
17# TODO(kjellander): Reduce this list to as small as possible.
kjellander38c65c82017-04-13 05:43:3818disable=
19 E0611,
20 I0010,
21 I0011,
22 W0232,
Artem Titov5d7a4c62018-07-23 11:58:2523 C0413,
kjellander38c65c82017-04-13 05:43:3824 bad-continuation,
25 broad-except,
26 duplicate-code,
27 eval-used,
28 exec-used,
29 fixme,
30 import-error,
31 missing-docstring,
32 no-init,
33 no-member,
34 too-few-public-methods,
35 too-many-ancestors,
36 too-many-arguments,
37 too-many-branches,
38 too-many-function-args,
39 too-many-instance-attributes,
40 too-many-lines,
41 too-many-locals,
42 too-many-public-methods,
43 too-many-return-statements,
44 too-many-statements,
Henrik Kjellander57e5fd22015-05-25 10:55:3945
46
47[REPORTS]
48
49# Don't write out full reports, just messages.
50reports=no
51
52
kjellander38c65c82017-04-13 05:43:3853[VARIABLES]
54
55# Tells whether we should check for unused import in __init__ files.
56init-import=no
57
58# A regular expression matching the beginning of the name of dummy variables
59# (i.e. not used).
60dummy-variables-rgx=_|dummy
61
62
63[TYPECHECK]
64
65# Tells whether missing members accessed in mixin class should be ignored. A
66# mixin class is detected if its name ends with "mixin" (case insensitive).
67ignore-mixin-members=yes
68
69# List of classes names for which member attributes should not be checked
70# (useful for classes with attributes dynamically set).
71ignored-classes=hashlib,numpy
72
73
74[MISCELLANEOUS]
75
76# List of note tags to take in consideration, separated by a comma.
77notes=FIXME,XXX,TODO
78
79
80[SIMILARITIES]
81
82# Minimum lines number of a similarity.
83min-similarity-lines=4
84
85# Ignore comments when computing similarities.
86ignore-comments=yes
87
88# Ignore docstrings when computing similarities.
89ignore-docstrings=yes
90
91
Henrik Kjellander57e5fd22015-05-25 10:55:3992[FORMAT]
93
kjellander38c65c82017-04-13 05:43:3894# Maximum number of characters on a single line.
95max-line-length=80
96
97# Maximum number of lines in a module
98max-module-lines=1000
99
kjellander38c65c82017-04-13 05:43:38100
101[BASIC]
102
103# List of builtins function names that should not be used, separated by a comma
104bad-functions=map,filter,apply,input
105
106# Regular expression which should only match correct module names
107module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
108
109# Regular expression which should only match correct module level names
110# (CAPS_WITH_UNDER)
111const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
112
113# Regular expression which should only match correct class names
114# (CapWords)
115class-rgx=[A-Z_][a-zA-Z0-9]+$
116
Mirko Bonadei9012b092020-11-09 16:48:04117# Regular expression which should only match correct function names
118# The Chromium standard is different than PEP-8, so we need to redefine this to
119# only allow:
120# - CapWords
121# - main: Standard for main function.
122function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$
123
124# Regular expression which should only match correct method names
125# The Chromium standard is different than PEP-8, so we need to redefine this to
126# only allow:
127# - CapWords, starting with a capital letter. No underscores in function
128# names. Can also have a "_" prefix (private method) or a "test" prefix
129# (unit test).
130# - Methods that look like __xyz__, which are used to do things like
131# __init__, __del__, etc.
132# - setUp, tearDown: For unit tests.
133method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$
134
kjellander38c65c82017-04-13 05:43:38135# Regular expression which should only match correct instance attribute names
136attr-rgx=[a-z_][a-z0-9_]{2,30}$
137
138# Regular expression which should only match correct argument names
139argument-rgx=[a-z_][a-z0-9_]{2,30}$
140
141# Regular expression which should only match correct variable names
142variable-rgx=[a-z_][a-z0-9_]{0,30}$
143
144# Regular expression which should only match correct list comprehension /
145# generator expression variable names
146inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
147
148# Good variable names which should always be accepted, separated by a comma
149good-names=i,j,k,ex,Run,_
150
151# Bad variable names which should always be refused, separated by a comma
152bad-names=foo,bar,baz,toto,tutu,tata
153
154# Regular expression which should only match functions or classes name which do
155# not require a docstring
156no-docstring-rgx=__.*__
157
158
159[DESIGN]
160
161# Maximum number of arguments for function / method
162max-args=5
163
164# Argument names that match this expression will be ignored. Default to name
165# with leading underscore
166ignored-argument-names=_.*
167
168# Maximum number of locals for function / method body
169max-locals=15
170
171# Maximum number of return / yield for function / method body
172max-returns=6
173
174# Maximum number of branch for function / method body
175max-branchs=12
176
177# Maximum number of statements in function / method body
178max-statements=50
179
180# Maximum number of parents for a class (see R0901).
181max-parents=7
182
183# Maximum number of attributes for a class (see R0902).
184max-attributes=7
185
186# Minimum number of public methods for a class (see R0903).
187min-public-methods=2
188
189# Maximum number of public methods for a class (see R0904).
190max-public-methods=20
191
192
193[CLASSES]
194
195# List of interface methods to ignore, separated by a comma. This is used for
196# instance to not check methods defines in Zope's Interface base class.
197ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
198
199# List of method names used to declare (i.e. assign) instance attributes.
200defining-attr-methods=__init__,__new__,setUp
201
202# List of valid names for the first argument in a class method.
203valid-classmethod-first-arg=cls
204
205
206[IMPORTS]
207
208# Deprecated modules which should not be used, separated by a comma
209deprecated-modules=regsub,TERMIOS,Bastion,rexec
210
211
212[EXCEPTIONS]
213
214# Exceptions that will emit a warning when being caught. Defaults to
215# "Exception"
216overgeneral-exceptions=Exception