blob: 5f82b2c9acde62ab8ee49603eedb2f76eb888ac2 [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,
Christoffer Jansson4e8a7732022-02-08 08:01:1231 import-outside-toplevel,
kjellander38c65c82017-04-13 05:43:3832 missing-docstring,
33 no-init,
34 no-member,
35 too-few-public-methods,
36 too-many-ancestors,
37 too-many-arguments,
38 too-many-branches,
39 too-many-function-args,
40 too-many-instance-attributes,
41 too-many-lines,
42 too-many-locals,
43 too-many-public-methods,
44 too-many-return-statements,
45 too-many-statements,
Henrik Kjellander57e5fd22015-05-25 10:55:3946
47
48[REPORTS]
49
50# Don't write out full reports, just messages.
51reports=no
52
53
kjellander38c65c82017-04-13 05:43:3854[VARIABLES]
55
56# Tells whether we should check for unused import in __init__ files.
57init-import=no
58
59# A regular expression matching the beginning of the name of dummy variables
60# (i.e. not used).
61dummy-variables-rgx=_|dummy
62
63
64[TYPECHECK]
65
66# Tells whether missing members accessed in mixin class should be ignored. A
67# mixin class is detected if its name ends with "mixin" (case insensitive).
68ignore-mixin-members=yes
69
70# List of classes names for which member attributes should not be checked
71# (useful for classes with attributes dynamically set).
72ignored-classes=hashlib,numpy
73
74
75[MISCELLANEOUS]
76
77# List of note tags to take in consideration, separated by a comma.
78notes=FIXME,XXX,TODO
79
80
81[SIMILARITIES]
82
83# Minimum lines number of a similarity.
84min-similarity-lines=4
85
86# Ignore comments when computing similarities.
87ignore-comments=yes
88
89# Ignore docstrings when computing similarities.
90ignore-docstrings=yes
91
92
Henrik Kjellander57e5fd22015-05-25 10:55:3993[FORMAT]
94
kjellander38c65c82017-04-13 05:43:3895# Maximum number of characters on a single line.
Emil Lundmark7892f052023-09-25 15:29:1396max-line-length=79
kjellander38c65c82017-04-13 05:43:3897
98# Maximum number of lines in a module
99max-module-lines=1000
100
Emil Lundmark7892f052023-09-25 15:29:13101# Use four spaces for indents.
102indent-string=' '
Jeremy Lecontef22c78b2021-12-07 18:49:48103
kjellander38c65c82017-04-13 05:43:38104
105[BASIC]
106
107# List of builtins function names that should not be used, separated by a comma
108bad-functions=map,filter,apply,input
109
Emil Lundmark7892f052023-09-25 15:29:13110# Naming style matching correct module names.
111module-naming-style=snake_case
kjellander38c65c82017-04-13 05:43:38112
Emil Lundmark7892f052023-09-25 15:29:13113# Naming style matching correct constant names.
114const-naming-style=UPPER_CASE
kjellander38c65c82017-04-13 05:43:38115
Emil Lundmark7892f052023-09-25 15:29:13116# Naming style matching correct class names.
117class-naming-style=PascalCase
kjellander38c65c82017-04-13 05:43:38118
Emil Lundmark7892f052023-09-25 15:29:13119# Naming style matching correct function names.
120function-naming-style=snake_case
Mirko Bonadei9012b092020-11-09 16:48:04121
Emil Lundmark7892f052023-09-25 15:29:13122# Regular expression matching correct method names.
123method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$
Mirko Bonadei9012b092020-11-09 16:48:04124
Emil Lundmark7892f052023-09-25 15:29:13125# Naming style matching correct attribute names.
126attr-naming-style=snake_case
kjellander38c65c82017-04-13 05:43:38127
Emil Lundmark7892f052023-09-25 15:29:13128# Naming style matching correct argument names.
129argument-naming-style=snake_case
kjellander38c65c82017-04-13 05:43:38130
Emil Lundmark7892f052023-09-25 15:29:13131# Naming style matching correct variable names.
132variable-naming-style=snake_case
kjellander38c65c82017-04-13 05:43:38133
134# Regular expression which should only match correct list comprehension /
135# generator expression variable names
136inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
137
138# Good variable names which should always be accepted, separated by a comma
139good-names=i,j,k,ex,Run,_
140
141# Bad variable names which should always be refused, separated by a comma
142bad-names=foo,bar,baz,toto,tutu,tata
143
144# Regular expression which should only match functions or classes name which do
145# not require a docstring
146no-docstring-rgx=__.*__
147
148
149[DESIGN]
150
151# Maximum number of arguments for function / method
152max-args=5
153
154# Argument names that match this expression will be ignored. Default to name
155# with leading underscore
156ignored-argument-names=_.*
157
158# Maximum number of locals for function / method body
159max-locals=15
160
161# Maximum number of return / yield for function / method body
162max-returns=6
163
164# Maximum number of branch for function / method body
165max-branchs=12
166
167# Maximum number of statements in function / method body
168max-statements=50
169
170# Maximum number of parents for a class (see R0901).
171max-parents=7
172
173# Maximum number of attributes for a class (see R0902).
174max-attributes=7
175
176# Minimum number of public methods for a class (see R0903).
177min-public-methods=2
178
179# Maximum number of public methods for a class (see R0904).
180max-public-methods=20
181
182
183[CLASSES]
184
kjellander38c65c82017-04-13 05:43:38185# List of method names used to declare (i.e. assign) instance attributes.
186defining-attr-methods=__init__,__new__,setUp
187
188# List of valid names for the first argument in a class method.
189valid-classmethod-first-arg=cls
190
191
192[IMPORTS]
193
194# Deprecated modules which should not be used, separated by a comma
195deprecated-modules=regsub,TERMIOS,Bastion,rexec
196
197
198[EXCEPTIONS]
199
200# Exceptions that will emit a warning when being caught. Defaults to
201# "Exception"
202overgeneral-exceptions=Exception