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