Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: pylintrc

Issue 2737963003: Update pylintrc to catch more style violations. (Closed)
Patch Set: Added OWNERS Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 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
1 [MESSAGES CONTROL] 14 [MESSAGES CONTROL]
2 15
3 # Disable the message, report, category or checker with the given id(s). 16 # Disable the message, report, category or checker with the given id(s).
4 # TODO(kjellander): Reduce this list to as small as possible. 17 # TODO(kjellander): Reduce this list to as small as possible.
5 disable=I0010,I0011,bad-continuation,broad-except,duplicate-code,eval-used,exec- used,fixme,invalid-name,missing-docstring,no-init,no-member,too-few-public-metho ds,too-many-ancestors,too-many-arguments,too-many-branches,too-many-function-arg s,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-public-me thods,too-many-return-statements,too-many-statements 18 disable=
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,
6 44
7 45
8 [REPORTS] 46 [REPORTS]
9 47
10 # Don't write out full reports, just messages. 48 # Don't write out full reports, just messages.
11 reports=no 49 reports=no
12 50
13 51
52 [VARIABLES]
53
54 # Tells whether we should check for unused import in __init__ files.
55 init-import=no
56
57 # A regular expression matching the beginning of the name of dummy variables
58 # (i.e. not used).
59 dummy-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).
66 ignore-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).
70 ignored-classes=hashlib,numpy
71
72
73 [MISCELLANEOUS]
74
75 # List of note tags to take in consideration, separated by a comma.
76 notes=FIXME,XXX,TODO
77
78
79 [SIMILARITIES]
80
81 # Minimum lines number of a similarity.
82 min-similarity-lines=4
83
84 # Ignore comments when computing similarities.
85 ignore-comments=yes
86
87 # Ignore docstrings when computing similarities.
88 ignore-docstrings=yes
89
90
14 [FORMAT] 91 [FORMAT]
15 92
93 # Maximum number of characters on a single line.
94 max-line-length=80
95
96 # Maximum number of lines in a module
97 max-module-lines=1000
98
16 # We use two spaces for indents, instead of the usual four spaces or tab. 99 # We use two spaces for indents, instead of the usual four spaces or tab.
17 indent-string=' ' 100 indent-string=' '
101
102
103 [BASIC]
104
105 # List of builtins function names that should not be used, separated by a comma
106 bad-functions=map,filter,apply,input
107
108 # Regular expression which should only match correct module names
109 module-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)
113 const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
114
115 # Regular expression which should only match correct class names
116 # (CapWords)
117 class-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.
124 function-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.
135 method-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
138 attr-rgx=[a-z_][a-z0-9_]{2,30}$
139
140 # Regular expression which should only match correct argument names
141 argument-rgx=[a-z_][a-z0-9_]{2,30}$
142
143 # Regular expression which should only match correct variable names
144 variable-rgx=[a-z_][a-z0-9_]{0,30}$
145
146 # Regular expression which should only match correct list comprehension /
147 # generator expression variable names
148 inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
149
150 # Good variable names which should always be accepted, separated by a comma
151 good-names=i,j,k,ex,Run,_
152
153 # Bad variable names which should always be refused, separated by a comma
154 bad-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
158 no-docstring-rgx=__.*__
159
160
161 [DESIGN]
162
163 # Maximum number of arguments for function / method
164 max-args=5
165
166 # Argument names that match this expression will be ignored. Default to name
167 # with leading underscore
168 ignored-argument-names=_.*
169
170 # Maximum number of locals for function / method body
171 max-locals=15
172
173 # Maximum number of return / yield for function / method body
174 max-returns=6
175
176 # Maximum number of branch for function / method body
177 max-branchs=12
178
179 # Maximum number of statements in function / method body
180 max-statements=50
181
182 # Maximum number of parents for a class (see R0901).
183 max-parents=7
184
185 # Maximum number of attributes for a class (see R0902).
186 max-attributes=7
187
188 # Minimum number of public methods for a class (see R0903).
189 min-public-methods=2
190
191 # Maximum number of public methods for a class (see R0904).
192 max-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.
199 ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions ,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,ge tTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,a daptWith,is_implemented_by
200
201 # List of method names used to declare (i.e. assign) instance attributes.
202 defining-attr-methods=__init__,__new__,setUp
203
204 # List of valid names for the first argument in a class method.
205 valid-classmethod-first-arg=cls
206
207
208 [IMPORTS]
209
210 # Deprecated modules which should not be used, separated by a comma
211 deprecated-modules=regsub,TERMIOS,Bastion,rexec
212
213
214 [EXCEPTIONS]
215
216 # Exceptions that will emit a warning when being caught. Defaults to
217 # "Exception"
218 overgeneral-exceptions=Exception
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698