blob: 69b599b2f692ee0b96ee41be2fd0be4ad1b33f84 [file] [log] [blame]
Jeremy Leconte3d476f22023-10-17 13:04:241# 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
14[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.
18disable=
19 E0611,
20 I0010,
21 I0011,
22 W0232,
23 C0413,
24 bad-continuation,
25 broad-except,
26 duplicate-code,
27 eval-used,
28 exec-used,
29 fixme,
30 import-error,
31 import-outside-toplevel,
32 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,
46
47
48[REPORTS]
49
50# Don't write out full reports, just messages.
51reports=no
52
53
54[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
93[FORMAT]
94
95# Maximum number of characters on a single line.
96max-line-length=80
97
98# Maximum number of lines in a module
99max-module-lines=1000
100
101# Use four spaces for indents.
102# indent-string=' '
103
104
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
110# Regular expression which should only match correct module names
111module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
112
113# Regular expression which should only match correct module level names
114# (CAPS_WITH_UNDER)
115const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
116
117# Regular expression which should only match correct class names
118# (CapWords)
119class-rgx=[A-Z_][a-zA-Z0-9]+$
120
121# Regular expression which should only match correct function names
122# The Chromium standard is different than PEP-8, so we need to redefine this to
123# only allow:
124# - CapWords
125# - main: Standard for main function.
126function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$
127
128# Regular expression which should only match correct method names
129# The Chromium standard is different than PEP-8, so we need to redefine this to
130# only allow:
131# - CapWords, starting with a capital letter. No underscores in function
132# names. Can also have a "_" prefix (private method) or a "test" prefix
133# (unit test).
134# - Methods that look like __xyz__, which are used to do things like
135# __init__, __del__, etc.
136# - setUp, tearDown: For unit tests.
137method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$
138
139# Regular expression which should only match correct instance attribute names
140attr-rgx=[a-z_][a-z0-9_]{2,30}$
141
142# Regular expression which should only match correct argument names
143argument-rgx=[a-z_][a-z0-9_]{2,30}$
144
145# Regular expression which should only match correct variable names
146variable-rgx=[a-z_][a-z0-9_]{0,30}$
147
148# Regular expression which should only match correct list comprehension /
149# generator expression variable names
150inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
151
152# Good variable names which should always be accepted, separated by a comma
153good-names=i,j,k,ex,Run,_
154
155# Bad variable names which should always be refused, separated by a comma
156bad-names=foo,bar,baz,toto,tutu,tata
157
158# Regular expression which should only match functions or classes name which do
159# not require a docstring
160no-docstring-rgx=__.*__
161
162
163[DESIGN]
164
165# Maximum number of arguments for function / method
166max-args=5
167
168# Argument names that match this expression will be ignored. Default to name
169# with leading underscore
170ignored-argument-names=_.*
171
172# Maximum number of locals for function / method body
173max-locals=15
174
175# Maximum number of return / yield for function / method body
176max-returns=6
177
178# Maximum number of branch for function / method body
179max-branchs=12
180
181# Maximum number of statements in function / method body
182max-statements=50
183
184# Maximum number of parents for a class (see R0901).
185max-parents=7
186
187# Maximum number of attributes for a class (see R0902).
188max-attributes=7
189
190# Minimum number of public methods for a class (see R0903).
191min-public-methods=2
192
193# Maximum number of public methods for a class (see R0904).
194max-public-methods=20
195
196
197[CLASSES]
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