blob: 6d40f783ca8117aa600d9937ba4f1b7a585ea01b [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,
30 missing-docstring,
31 no-init,
32 no-member,
33 too-few-public-methods,
34 too-many-ancestors,
35 too-many-arguments,
36 too-many-branches,
37 too-many-function-args,
38 too-many-instance-attributes,
39 too-many-lines,
40 too-many-locals,
41 too-many-public-methods,
42 too-many-return-statements,
43 too-many-statements,
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020044
45
46[REPORTS]
47
48# Don't write out full reports, just messages.
49reports=no
50
51
kjellander38c65c82017-04-12 22:43:38 -070052[VARIABLES]
53
54# Tells whether we should check for unused import in __init__ files.
55init-import=no
56
57# A regular expression matching the beginning of the name of dummy variables
58# (i.e. not used).
59dummy-variables-rgx=_|dummy
60
61
62[TYPECHECK]
63
64# Tells whether missing members accessed in mixin class should be ignored. A
65# mixin class is detected if its name ends with "mixin" (case insensitive).
66ignore-mixin-members=yes
67
68# List of classes names for which member attributes should not be checked
69# (useful for classes with attributes dynamically set).
70ignored-classes=hashlib,numpy
71
72
73[MISCELLANEOUS]
74
75# List of note tags to take in consideration, separated by a comma.
76notes=FIXME,XXX,TODO
77
78
79[SIMILARITIES]
80
81# Minimum lines number of a similarity.
82min-similarity-lines=4
83
84# Ignore comments when computing similarities.
85ignore-comments=yes
86
87# Ignore docstrings when computing similarities.
88ignore-docstrings=yes
89
90
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020091[FORMAT]
92
kjellander38c65c82017-04-12 22:43:38 -070093# Maximum number of characters on a single line.
94max-line-length=80
95
96# Maximum number of lines in a module
97max-module-lines=1000
98
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020099# We use two spaces for indents, instead of the usual four spaces or tab.
100indent-string=' '
kjellander38c65c82017-04-12 22:43:38 -0700101
102
103[BASIC]
104
105# List of builtins function names that should not be used, separated by a comma
106bad-functions=map,filter,apply,input
107
108# Regular expression which should only match correct module names
109module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
110
111# Regular expression which should only match correct module level names
112# (CAPS_WITH_UNDER)
113const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
114
115# Regular expression which should only match correct class names
116# (CapWords)
117class-rgx=[A-Z_][a-zA-Z0-9]+$
118
119# Regular expression which should only match correct function names
120# The Chromium standard is different than PEP-8, so we need to redefine this to
121# only allow:
122# - CapWords
123# - main: Standard for main function.
124function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$
125
126# Regular expression which should only match correct method names
127# The Chromium standard is different than PEP-8, so we need to redefine this to
128# only allow:
129# - CapWords, starting with a capital letter. No underscores in function
130# names. Can also have a "_" prefix (private method) or a "test" prefix
131# (unit test).
132# - Methods that look like __xyz__, which are used to do things like
133# __init__, __del__, etc.
134# - setUp, tearDown: For unit tests.
135method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$
136
137# Regular expression which should only match correct instance attribute names
138attr-rgx=[a-z_][a-z0-9_]{2,30}$
139
140# Regular expression which should only match correct argument names
141argument-rgx=[a-z_][a-z0-9_]{2,30}$
142
143# Regular expression which should only match correct variable names
144variable-rgx=[a-z_][a-z0-9_]{0,30}$
145
146# Regular expression which should only match correct list comprehension /
147# generator expression variable names
148inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
149
150# Good variable names which should always be accepted, separated by a comma
151good-names=i,j,k,ex,Run,_
152
153# Bad variable names which should always be refused, separated by a comma
154bad-names=foo,bar,baz,toto,tutu,tata
155
156# Regular expression which should only match functions or classes name which do
157# not require a docstring
158no-docstring-rgx=__.*__
159
160
161[DESIGN]
162
163# Maximum number of arguments for function / method
164max-args=5
165
166# Argument names that match this expression will be ignored. Default to name
167# with leading underscore
168ignored-argument-names=_.*
169
170# Maximum number of locals for function / method body
171max-locals=15
172
173# Maximum number of return / yield for function / method body
174max-returns=6
175
176# Maximum number of branch for function / method body
177max-branchs=12
178
179# Maximum number of statements in function / method body
180max-statements=50
181
182# Maximum number of parents for a class (see R0901).
183max-parents=7
184
185# Maximum number of attributes for a class (see R0902).
186max-attributes=7
187
188# Minimum number of public methods for a class (see R0903).
189min-public-methods=2
190
191# Maximum number of public methods for a class (see R0904).
192max-public-methods=20
193
194
195[CLASSES]
196
197# List of interface methods to ignore, separated by a comma. This is used for
198# instance to not check methods defines in Zope's Interface base class.
199ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
200
201# List of method names used to declare (i.e. assign) instance attributes.
202defining-attr-methods=__init__,__new__,setUp
203
204# List of valid names for the first argument in a class method.
205valid-classmethod-first-arg=cls
206
207
208[IMPORTS]
209
210# Deprecated modules which should not be used, separated by a comma
211deprecated-modules=regsub,TERMIOS,Bastion,rexec
212
213
214[EXCEPTIONS]
215
216# Exceptions that will emit a warning when being caught. Defaults to
217# "Exception"
218overgeneral-exceptions=Exception