blob: 083a79f7ff331bcd382001043e40d9168a0ea619 [file] [log] [blame]
kjellander38c65c82017-04-12 22:43:38 -07001# 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 12:55:39 +020014[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-12 22:43:38 -070018disable=
19 E0611,
20 I0010,
21 I0011,
22 W0232,
23 bad-continuation,
24 broad-except,
25 duplicate-code,
26 eval-used,
27 exec-used,
28 fixme,
29 import-error,
Henrik Kjellandera18a3bf2017-09-15 11:19:10 +020030 invalid-name,
kjellander38c65c82017-04-12 22:43:38 -070031 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 12:55:39 +020045
46
47[REPORTS]
48
49# Don't write out full reports, just messages.
50reports=no
51
52
kjellander38c65c82017-04-12 22:43:38 -070053[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 12:55:39 +020092[FORMAT]
93
kjellander38c65c82017-04-12 22:43:38 -070094# 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
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200100# We use two spaces for indents, instead of the usual four spaces or tab.
101indent-string=' '
kjellander38c65c82017-04-12 22:43:38 -0700102
103
104[BASIC]
105
106# List of builtins function names that should not be used, separated by a comma
107bad-functions=map,filter,apply,input
108
109# Regular expression which should only match correct module names
110module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
111
112# Regular expression which should only match correct module level names
113# (CAPS_WITH_UNDER)
114const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
115
116# Regular expression which should only match correct class names
117# (CapWords)
118class-rgx=[A-Z_][a-zA-Z0-9]+$
119
120# Regular expression which should only match correct function names
121# The Chromium standard is different than PEP-8, so we need to redefine this to
122# only allow:
123# - CapWords
124# - main: Standard for main function.
125function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$
126
127# Regular expression which should only match correct method names
128# The Chromium standard is different than PEP-8, so we need to redefine this to
129# only allow:
130# - CapWords, starting with a capital letter. No underscores in function
131# names. Can also have a "_" prefix (private method) or a "test" prefix
132# (unit test).
133# - Methods that look like __xyz__, which are used to do things like
134# __init__, __del__, etc.
135# - setUp, tearDown: For unit tests.
136method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$
137
138# Regular expression which should only match correct instance attribute names
139attr-rgx=[a-z_][a-z0-9_]{2,30}$
140
141# Regular expression which should only match correct argument names
142argument-rgx=[a-z_][a-z0-9_]{2,30}$
143
144# Regular expression which should only match correct variable names
145variable-rgx=[a-z_][a-z0-9_]{0,30}$
146
147# Regular expression which should only match correct list comprehension /
148# generator expression variable names
149inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
150
151# Good variable names which should always be accepted, separated by a comma
152good-names=i,j,k,ex,Run,_
153
154# Bad variable names which should always be refused, separated by a comma
155bad-names=foo,bar,baz,toto,tutu,tata
156
157# Regular expression which should only match functions or classes name which do
158# not require a docstring
159no-docstring-rgx=__.*__
160
161
162[DESIGN]
163
164# Maximum number of arguments for function / method
165max-args=5
166
167# Argument names that match this expression will be ignored. Default to name
168# with leading underscore
169ignored-argument-names=_.*
170
171# Maximum number of locals for function / method body
172max-locals=15
173
174# Maximum number of return / yield for function / method body
175max-returns=6
176
177# Maximum number of branch for function / method body
178max-branchs=12
179
180# Maximum number of statements in function / method body
181max-statements=50
182
183# Maximum number of parents for a class (see R0901).
184max-parents=7
185
186# Maximum number of attributes for a class (see R0902).
187max-attributes=7
188
189# Minimum number of public methods for a class (see R0903).
190min-public-methods=2
191
192# Maximum number of public methods for a class (see R0904).
193max-public-methods=20
194
195
196[CLASSES]
197
198# List of interface methods to ignore, separated by a comma. This is used for
199# instance to not check methods defines in Zope's Interface base class.
200ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
201
202# List of method names used to declare (i.e. assign) instance attributes.
203defining-attr-methods=__init__,__new__,setUp
204
205# List of valid names for the first argument in a class method.
206valid-classmethod-first-arg=cls
207
208
209[IMPORTS]
210
211# Deprecated modules which should not be used, separated by a comma
212deprecated-modules=regsub,TERMIOS,Bastion,rexec
213
214
215[EXCEPTIONS]
216
217# Exceptions that will emit a warning when being caught. Defaults to
218# "Exception"
219overgeneral-exceptions=Exception