xref: /aosp_15_r20/external/tensorflow/tensorflow/tools/ci_build/pylintrc (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1[MASTER]
2
3# Specify a configuration file.
4#rcfile=
5
6# Python code to execute, usually for sys.path manipulation such as
7# pygtk.require().
8#init-hook=
9
10# Profiled execution.
11profile=no
12
13# Add files or directories to the denylist. They should be base names, not
14# paths.
15ignore=CVS
16
17# Pickle collected data for later comparisons.
18persistent=yes
19
20# List of plugins (as comma separated values of python modules names) to load,
21# usually to register additional checkers.
22load-plugins=pylint.extensions.docparams
23accept-no-param-doc=no
24
25[MESSAGES CONTROL]
26
27# Disable the message, report, category or checker with the given id(s). You
28# can either give multiple identifiers separated by comma (,) or put this
29# option multiple times (only on the command line, not in the configuration
30# file where it should appear only once).You can also use "--disable=all" to
31# disable everything first and then reenable specific checks. For example, if
32# you want to run only the similarities checker, you can use "--disable=all
33# --enable=similarities". If you want to run only the classes checker, but have
34# no Warning level messages displayed, use"--disable=all --enable=classes
35# --disable=W"
36disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,not-context-manager,invalid-sequence-index,W,R,C,I
37
38# Enable the message, report, category or checker with the given id(s). You can
39# either give multiple identifier separated by comma (,) or put this option
40# multiple time. See also the "--disable" option for examples.
41# W0311 bad-indentation
42# W0312 mixed-indentation
43# C0330 bad-continuation
44# C0301 line-too-long
45# C0326 bad-whitespace
46# W0611 unused-import
47# W0622 redefined-builtin
48#(TODO) Some of these are not valid anymore:
49# https://github.com/tensorflow/tensorflow/issues/55442
50enable=indexing-exception,old-raise-syntax,W0311,W0312,C0330,C0301,C0326,W0611,W0622
51
52# Set the cache size for astng objects.
53cache-size=500
54
55
56[REPORTS]
57
58# Set the output format. Available formats are text, parseable, colorized, msvs
59# (visual studio) and html. You can also give a reporter class, eg
60# mypackage.mymodule.MyReporterClass.
61output-format=text
62
63# Put messages in a separate file for each module / package specified on the
64# command line instead of printing them on stdout. Reports (if any) will be
65# written in a file name "pylint_global.[txt|html]".
66files-output=no
67
68# Tells whether to display a full report or only the messages
69reports=no
70
71# Python expression which should return a note less than 10 (10 is the highest
72# note). You have access to the variables errors warning, statement which
73# respectively contain the number of errors / warnings messages and the total
74# number of statements analyzed. This is used by the global evaluation report
75# (RP0004).
76evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
77
78# Add a comment according to your evaluation note. This is used by the global
79# evaluation report (RP0004).
80comment=no
81
82# Template used to display messages. This is a python new-style format string
83# used to format the message information. See doc for all details
84#msg-template=
85
86
87[TYPECHECK]
88
89# Tells whether missing members accessed in mixin class should be ignored. A
90# mixin class is detected if its name ends with "mixin" (case insensitive).
91ignore-mixin-members=yes
92
93# List of classes names for which member attributes should not be checked
94# (useful for classes with attributes dynamically set).
95ignored-classes=SQLObject
96
97# When zope mode is activated, add a predefined set of Zope acquired attributes
98# to generated-members.
99zope=no
100
101# List of members which are set dynamically and missed by pylint inference
102# system, and so shouldn't trigger E0201 when accessed. Python regular
103# expressions are accepted.
104generated-members=REQUEST,acl_users,aq_parent
105
106# List of decorators that create context managers from functions, such as
107# contextlib.contextmanager.
108contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
109
110
111[VARIABLES]
112
113# Tells whether we should check for unused import in __init__ files.
114init-import=no
115
116# A regular expression matching the beginning of the name of dummy variables
117# (i.e. not used).
118dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
119
120# List of additional names supposed to be defined in builtins. Remember that
121# you should avoid to define new builtins when possible.
122additional-builtins=
123
124
125[BASIC]
126
127# Required attributes for module, separated by a comma
128required-attributes=
129
130# List of builtins function names that should not be used, separated by a comma
131bad-functions=apply,input,reduce
132
133
134# Disable the report(s) with the given id(s).
135# All non-Google reports are disabled by default.
136disable-report=R0001,R0002,R0003,R0004,R0101,R0102,R0201,R0202,R0220,R0401,R0402,R0701,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,R0923
137
138# Regular expression which should only match correct module names
139module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
140
141# Regular expression which should only match correct module level names
142const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
143
144# Regular expression which should only match correct class names
145class-rgx=^_?[A-Z][a-zA-Z0-9]*$
146
147# Regular expression which should only match correct function names
148function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
149
150# Regular expression which should only match correct method names
151method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
152
153# Regular expression which should only match correct instance attribute names
154attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
155
156# Regular expression which should only match correct argument names
157argument-rgx=^[a-z][a-z0-9_]*$
158
159# Regular expression which should only match correct variable names
160variable-rgx=^[a-z][a-z0-9_]*$
161
162# Regular expression which should only match correct attribute names in class
163# bodies
164class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
165
166# Regular expression which should only match correct list comprehension /
167# generator expression variable names
168inlinevar-rgx=^[a-z][a-z0-9_]*$
169
170# Good variable names which should always be accepted, separated by a comma
171good-names=main,_
172
173# Bad variable names which should always be refused, separated by a comma
174bad-names=
175
176# Regular expression which should only match function or class names that do
177# not require a docstring.
178no-docstring-rgx=(__.*__|main)
179
180# Minimum line length for functions/classes that require docstrings, shorter
181# ones are exempt.
182docstring-min-length=10
183
184
185[FORMAT]
186
187# Maximum number of characters on a single line.
188max-line-length=80
189
190# Regexp for a line that is allowed to be longer than the limit.
191ignore-long-lines=(?x)
192  (^\s*(import|from)\s
193   |\$Id:\s\/\/depot\/.+#\d+\s\$
194   |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+')
195   |^\s*\#\ LINT\.ThenChange
196   |^[^#]*\#\ type:\ [a-zA-Z_][a-zA-Z0-9_.,[\] ]*$
197   |pylint
198   |"""
199   |\#
200   |lambda
201   |(https?|ftp):)
202
203# Allow the body of an if to be on the same line as the test if there is no
204# else.
205single-line-if-stmt=y
206
207# List of optional constructs for which whitespace checking is disabled
208no-space-check=
209
210# Maximum number of lines in a module
211max-module-lines=99999
212
213# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
214# tab).
215indent-string='  '
216
217
218[SIMILARITIES]
219
220# Minimum lines number of a similarity.
221min-similarity-lines=4
222
223# Ignore comments when computing similarities.
224ignore-comments=yes
225
226# Ignore docstrings when computing similarities.
227ignore-docstrings=yes
228
229# Ignore imports when computing similarities.
230ignore-imports=no
231
232
233[MISCELLANEOUS]
234
235# List of note tags to take in consideration, separated by a comma.
236notes=
237
238
239[IMPORTS]
240
241# Deprecated modules which should not be used, separated by a comma
242deprecated-modules=regsub,TERMIOS,Bastion,rexec,sets
243
244# Create a graph of every (i.e. internal and external) dependencies in the
245# given file (report RP0402 must not be disabled)
246import-graph=
247
248# Create a graph of external dependencies in the given file (report RP0402 must
249# not be disabled)
250ext-import-graph=
251
252# Create a graph of internal dependencies in the given file (report RP0402 must
253# not be disabled)
254int-import-graph=
255
256
257[CLASSES]
258
259# List of interface methods to ignore, separated by a comma. This is used for
260# instance to not check methods defines in Zope's Interface base class.
261ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
262
263# List of method names used to declare (i.e. assign) instance attributes.
264defining-attr-methods=__init__,__new__,setUp
265
266# List of valid names for the first argument in a class method.
267valid-classmethod-first-arg=cls,class_
268
269# List of valid names for the first argument in a metaclass class method.
270valid-metaclass-classmethod-first-arg=mcs
271
272
273[DESIGN]
274
275# Maximum number of arguments for function / method
276max-args=5
277
278# Argument names that match this expression will be ignored. Default to name
279# with leading underscore
280ignored-argument-names=_.*
281
282# Maximum number of locals for function / method body
283max-locals=15
284
285# Maximum number of return / yield for function / method body
286max-returns=6
287
288# Maximum number of branch for function / method body
289max-branches=12
290
291# Maximum number of statements in function / method body
292max-statements=50
293
294# Maximum number of parents for a class (see R0901).
295max-parents=7
296
297# Maximum number of attributes for a class (see R0902).
298max-attributes=7
299
300# Minimum number of public methods for a class (see R0903).
301min-public-methods=2
302
303# Maximum number of public methods for a class (see R0904).
304max-public-methods=20
305
306
307[EXCEPTIONS]
308
309# Exceptions that will emit a warning when being caught. Defaults to
310# "Exception"
311overgeneral-exceptions=Exception,StandardError,BaseException
312
313
314[AST]
315
316# Maximum line length for lambdas
317short-func-length=1
318
319# List of module members that should be marked as deprecated.
320# All of the string functions are listed in 4.1.4 Deprecated string functions
321# in the Python 2.4 docs.
322deprecated-members=string.atof,string.atoi,string.atol,string.capitalize,string.expandtabs,string.find,string.rfind,string.index,string.rindex,string.count,string.lower,string.split,string.rsplit,string.splitfields,string.join,string.joinfields,string.lstrip,string.rstrip,string.strip,string.swapcase,string.translate,string.upper,string.ljust,string.rjust,string.center,string.zfill,string.replace,sys.exitfunc
323
324
325[DOCSTRING]
326
327default-docstring-type=google
328# List of exceptions that do not need to be mentioned in the Raises section of
329# a docstring.
330ignore-exceptions=AssertionError,NotImplementedError,StopIteration,TypeError
331
332
333
334[TOKENS]
335
336# Number of spaces of indent required when the last token on the preceding line
337# is an open (, [, or {.
338indent-after-paren=4
339
340
341[GOOGLE LINES]
342
343# Regexp for a proper copyright notice.
344copyright=Copyright \d{4} The TensorFlow Authors\. +All [Rr]ights [Rr]eserved\.
345