1 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
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.
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
16 # Disable the message, report, category or checker with the given id(s).
17 # TODO(kjellander): Reduce this list to as small as possible.
31 import-outside-toplevel,
35 too-few-public-methods,
39 too-many-function-args,
40 too-many-instance-attributes,
43 too-many-public-methods,
44 too-many-return-statements,
50 # Don't write out full reports, just messages.
56 # Tells whether we should check for unused import in __init__ files.
59 # A regular expression matching the beginning of the name of dummy variables
61 dummy-variables-rgx=_|dummy
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).
68 ignore-mixin-members=yes
70 # List of classes names for which member attributes should not be checked
71 # (useful for classes with attributes dynamically set).
72 ignored-classes=hashlib,numpy
77 # List of note tags to take in consideration, separated by a comma.
83 # Minimum lines number of a similarity.
84 min-similarity-lines=4
86 # Ignore comments when computing similarities.
89 # Ignore docstrings when computing similarities.
95 # Maximum number of characters on a single line.
98 # Maximum number of lines in a module
101 # Use four spaces for indents.
107 # List of builtins function names that should not be used, separated by a comma
108 bad-functions=map,filter,apply,input
110 # Regular expression which should only match correct module names
111 module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
113 # Regular expression which should only match correct module level names
115 const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
117 # Regular expression which should only match correct class names
119 class-rgx=[A-Z_][a-zA-Z0-9]+$
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
125 # - main: Standard for main function.
126 function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$
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
131 # - CapWords, starting with a capital letter. No underscores in function
132 # names. Can also have a "_" prefix (private method) or a "test" prefix
134 # - Methods that look like __xyz__, which are used to do things like
135 # __init__, __del__, etc.
136 # - setUp, tearDown: For unit tests.
137 method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$
139 # Regular expression which should only match correct instance attribute names
140 attr-rgx=[a-z_][a-z0-9_]{2,30}$
142 # Regular expression which should only match correct argument names
143 argument-rgx=[a-z_][a-z0-9_]{2,30}$
145 # Regular expression which should only match correct variable names
146 variable-rgx=[a-z_][a-z0-9_]{0,30}$
148 # Regular expression which should only match correct list comprehension /
149 # generator expression variable names
150 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
152 # Good variable names which should always be accepted, separated by a comma
153 good-names=i,j,k,ex,Run,_
155 # Bad variable names which should always be refused, separated by a comma
156 bad-names=foo,bar,baz,toto,tutu,tata
158 # Regular expression which should only match functions or classes name which do
159 # not require a docstring
160 no-docstring-rgx=__.*__
165 # Maximum number of arguments for function / method
168 # Argument names that match this expression will be ignored. Default to name
169 # with leading underscore
170 ignored-argument-names=_.*
172 # Maximum number of locals for function / method body
175 # Maximum number of return / yield for function / method body
178 # Maximum number of branch for function / method body
181 # Maximum number of statements in function / method body
184 # Maximum number of parents for a class (see R0901).
187 # Maximum number of attributes for a class (see R0902).
190 # Minimum number of public methods for a class (see R0903).
193 # Maximum number of public methods for a class (see R0904).
194 max-public-methods=20
199 # List of method names used to declare (i.e. assign) instance attributes.
200 defining-attr-methods=__init__,__new__,setUp
202 # List of valid names for the first argument in a class method.
203 valid-classmethod-first-arg=cls
208 # Deprecated modules which should not be used, separated by a comma
209 deprecated-modules=regsub,TERMIOS,Bastion,rexec
214 # Exceptions that will emit a warning when being caught. Defaults to
216 overgeneral-exceptions=Exception