xref: /aosp_15_r20/external/antlr/runtime/Python/pylintrc (revision 16467b971bd3e2009fad32dd79016f2c7e421deb)
1*16467b97STreehugger Robot# lint Python modules using external checkers.
2*16467b97STreehugger Robot#
3*16467b97STreehugger Robot# This is the main checker controling the other ones and the reports
4*16467b97STreehugger Robot# generation. It is itself both a raw checker and an astng checker in order
5*16467b97STreehugger Robot# to:
6*16467b97STreehugger Robot# * handle message activation / deactivation at the module level
7*16467b97STreehugger Robot# * handle some basic but necessary stats'data (number of classes, methods...)
8*16467b97STreehugger Robot#
9*16467b97STreehugger Robot[MASTER]
10*16467b97STreehugger Robot
11*16467b97STreehugger Robot# Specify a configuration file.
12*16467b97STreehugger Robot#rcfile=
13*16467b97STreehugger Robot
14*16467b97STreehugger Robot# Profiled execution.
15*16467b97STreehugger Robotprofile=no
16*16467b97STreehugger Robot
17*16467b97STreehugger Robot# Add <file or directory> to the black list. It should be a base name, not a
18*16467b97STreehugger Robot# path. You may set this option multiple times.
19*16467b97STreehugger Robotignore=CVS
20*16467b97STreehugger Robot
21*16467b97STreehugger Robot# Pickle collected data for later comparisons.
22*16467b97STreehugger Robotpersistent=yes
23*16467b97STreehugger Robot
24*16467b97STreehugger Robot# Set the cache size for astng objects.
25*16467b97STreehugger Robotcache-size=500
26*16467b97STreehugger Robot
27*16467b97STreehugger Robot# List of plugins (as comma separated values of python modules names) to load,
28*16467b97STreehugger Robot# usually to register additional checkers.
29*16467b97STreehugger Robotload-plugins=
30*16467b97STreehugger Robot
31*16467b97STreehugger Robot
32*16467b97STreehugger Robot[COMMANDS]
33*16467b97STreehugger Robot
34*16467b97STreehugger Robot# Display a help message for the given message id and exit. The value may be a
35*16467b97STreehugger Robot# comma separated list of message ids.
36*16467b97STreehugger Robot#help-msg=
37*16467b97STreehugger Robot
38*16467b97STreehugger Robot
39*16467b97STreehugger Robot[MESSAGES CONTROL]
40*16467b97STreehugger Robot
41*16467b97STreehugger Robot# Enable only checker(s) with the given id(s). This option conflict with the
42*16467b97STreehugger Robot# disable-checker option
43*16467b97STreehugger Robot#enable-checker=
44*16467b97STreehugger Robot
45*16467b97STreehugger Robot# Enable all checker(s) except those with the given id(s). This option conflict
46*16467b97STreehugger Robot# with the disable-checker option
47*16467b97STreehugger Robot#disable-checker=
48*16467b97STreehugger Robot
49*16467b97STreehugger Robot# Enable all messages in the listed categories.
50*16467b97STreehugger Robot#enable-msg-cat=
51*16467b97STreehugger Robot
52*16467b97STreehugger Robot# Disable all messages in the listed categories.
53*16467b97STreehugger Robot#disable-msg-cat=
54*16467b97STreehugger Robot
55*16467b97STreehugger Robot# Enable the message(s) with the given id(s).
56*16467b97STreehugger Robot#enable-msg=
57*16467b97STreehugger Robot
58*16467b97STreehugger Robot# Disable the message(s) with the given id(s).
59*16467b97STreehugger Robot# W0622: Redefining built-in '...'
60*16467b97STreehugger Robot# C0103: Invalid name
61*16467b97STreehugger Robot# R0904: Too many public methods
62*16467b97STreehugger Robot# R0201: Method could be a function
63*16467b97STreehugger Robot# C0302: Too many lines in module
64*16467b97STreehugger Robot# R0902: Too many instance attributes
65*16467b97STreehugger Robot# R0913: Too many arguments
66*16467b97STreehugger Robot# R0912: Too many branches
67*16467b97STreehugger Robot# R0903: To few public methods
68*16467b97STreehugger Robot# C0111: Missing docstring
69*16467b97STreehugger Robot# W0403: Relative import
70*16467b97STreehugger Robot# W0401: Wildcard import
71*16467b97STreehugger Robot# W0142: */** magic
72*16467b97STreehugger Robotdisable-msg=W0622, C0103, R0904, R0201, C0302, R0902, R0913, R0912, R0903, C0111, W0403, W0401, W0142
73*16467b97STreehugger Robot
74*16467b97STreehugger Robot
75*16467b97STreehugger Robot[REPORTS]
76*16467b97STreehugger Robot
77*16467b97STreehugger Robot# set the output format. Available formats are text, parseable, colorized and
78*16467b97STreehugger Robot# html
79*16467b97STreehugger Robotoutput-format=text
80*16467b97STreehugger Robot
81*16467b97STreehugger Robot# Include message's id in output
82*16467b97STreehugger Robotinclude-ids=yes
83*16467b97STreehugger Robot
84*16467b97STreehugger Robot# Put messages in a separate file for each module / package specified on the
85*16467b97STreehugger Robot# command line instead of printing them on stdout. Reports (if any) will be
86*16467b97STreehugger Robot# written in a file name "pylint_global.[txt|html]".
87*16467b97STreehugger Robotfiles-output=no
88*16467b97STreehugger Robot
89*16467b97STreehugger Robot# Tells wether to display a full report or only the messages
90*16467b97STreehugger Robotreports=yes
91*16467b97STreehugger Robot
92*16467b97STreehugger Robot# Python expression which should return a note less than 10 (10 is the highest
93*16467b97STreehugger Robot# note).You have access to the variables errors warning, statement which
94*16467b97STreehugger Robot# respectivly contain the number of errors / warnings messages and the total
95*16467b97STreehugger Robot# number of statements analyzed. This is used by the global evaluation report
96*16467b97STreehugger Robot# (R0004).
97*16467b97STreehugger Robotevaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
98*16467b97STreehugger Robot
99*16467b97STreehugger Robot# Add a comment according to your evaluation note. This is used by the global
100*16467b97STreehugger Robot# evaluation report (R0004).
101*16467b97STreehugger Robotcomment=no
102*16467b97STreehugger Robot
103*16467b97STreehugger Robot# Enable the report(s) with the given id(s).
104*16467b97STreehugger Robot#enable-report=
105*16467b97STreehugger Robot
106*16467b97STreehugger Robot# Disable the report(s) with the given id(s).
107*16467b97STreehugger Robot#disable-report=
108*16467b97STreehugger Robot
109*16467b97STreehugger Robot
110*16467b97STreehugger Robot# try to find bugs in the code using type inference
111*16467b97STreehugger Robot#
112*16467b97STreehugger Robot[TYPECHECK]
113*16467b97STreehugger Robot
114*16467b97STreehugger Robot# Tells wether missing members accessed in mixin class should be ignored. A
115*16467b97STreehugger Robot# mixin class is detected if its name ends with "mixin" (case insensitive).
116*16467b97STreehugger Robotignore-mixin-members=yes
117*16467b97STreehugger Robot
118*16467b97STreehugger Robot# When zope mode is activated, consider the acquired-members option to ignore
119*16467b97STreehugger Robot# access to some undefined attributes.
120*16467b97STreehugger Robotzope=no
121*16467b97STreehugger Robot
122*16467b97STreehugger Robot# List of members which are usually get through zope's acquisition mecanism and
123*16467b97STreehugger Robot# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
124*16467b97STreehugger Robotacquired-members=REQUEST,acl_users,aq_parent
125*16467b97STreehugger Robot
126*16467b97STreehugger Robot
127*16467b97STreehugger Robot# checks for
128*16467b97STreehugger Robot# * unused variables / imports
129*16467b97STreehugger Robot# * undefined variables
130*16467b97STreehugger Robot# * redefinition of variable from builtins or from an outer scope
131*16467b97STreehugger Robot# * use of variable before assigment
132*16467b97STreehugger Robot#
133*16467b97STreehugger Robot[VARIABLES]
134*16467b97STreehugger Robot
135*16467b97STreehugger Robot# Tells wether we should check for unused import in __init__ files.
136*16467b97STreehugger Robotinit-import=no
137*16467b97STreehugger Robot
138*16467b97STreehugger Robot# A regular expression matching names used for dummy variables (i.e. not used).
139*16467b97STreehugger Robotdummy-variables-rgx=_|dummy
140*16467b97STreehugger Robot
141*16467b97STreehugger Robot# List of additional names supposed to be defined in builtins. Remember that
142*16467b97STreehugger Robot# you should avoid to define new builtins when possible.
143*16467b97STreehugger Robotadditional-builtins=
144*16467b97STreehugger Robot
145*16467b97STreehugger Robot
146*16467b97STreehugger Robot# checks for :
147*16467b97STreehugger Robot# * doc strings
148*16467b97STreehugger Robot# * modules / classes / functions / methods / arguments / variables name
149*16467b97STreehugger Robot# * number of arguments, local variables, branchs, returns and statements in
150*16467b97STreehugger Robot# functions, methods
151*16467b97STreehugger Robot# * required module attributes
152*16467b97STreehugger Robot# * dangerous default values as arguments
153*16467b97STreehugger Robot# * redefinition of function / method / class
154*16467b97STreehugger Robot# * uses of the global statement
155*16467b97STreehugger Robot#
156*16467b97STreehugger Robot[BASIC]
157*16467b97STreehugger Robot
158*16467b97STreehugger Robot# Required attributes for module, separated by a comma
159*16467b97STreehugger Robotrequired-attributes=
160*16467b97STreehugger Robot
161*16467b97STreehugger Robot# Regular expression which should only match functions or classes name which do
162*16467b97STreehugger Robot# not require a docstring
163*16467b97STreehugger Robotno-docstring-rgx=__.*__
164*16467b97STreehugger Robot
165*16467b97STreehugger Robot# Regular expression which should only match correct module names
166*16467b97STreehugger Robotmodule-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
167*16467b97STreehugger Robot
168*16467b97STreehugger Robot# Regular expression which should only match correct module level names
169*16467b97STreehugger Robotconst-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
170*16467b97STreehugger Robot
171*16467b97STreehugger Robot# Regular expression which should only match correct class names
172*16467b97STreehugger Robotclass-rgx=[A-Z_][a-zA-Z0-9]+$
173*16467b97STreehugger Robot
174*16467b97STreehugger Robot# Regular expression which should only match correct function names
175*16467b97STreehugger Robotfunction-rgx=[a-z_][a-z0-9_]{2,30}$
176*16467b97STreehugger Robot
177*16467b97STreehugger Robot# Regular expression which should only match correct method names
178*16467b97STreehugger Robotmethod-rgx=[a-z_][a-z0-9_]{2,30}$
179*16467b97STreehugger Robot
180*16467b97STreehugger Robot# Regular expression which should only match correct instance attribute names
181*16467b97STreehugger Robotattr-rgx=[a-z_][a-z0-9_]{2,30}$
182*16467b97STreehugger Robot
183*16467b97STreehugger Robot# Regular expression which should only match correct argument names
184*16467b97STreehugger Robotargument-rgx=[a-z_][a-z0-9_]{2,30}$
185*16467b97STreehugger Robot
186*16467b97STreehugger Robot# Regular expression which should only match correct variable names
187*16467b97STreehugger Robotvariable-rgx=[a-z_][a-z0-9_]{2,30}$
188*16467b97STreehugger Robot
189*16467b97STreehugger Robot# Regular expression which should only match correct list comprehension /
190*16467b97STreehugger Robot# generator expression variable names
191*16467b97STreehugger Robotinlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
192*16467b97STreehugger Robot
193*16467b97STreehugger Robot# Good variable names which should always be accepted, separated by a comma
194*16467b97STreehugger Robotgood-names=i,j,k,ex,Run,_
195*16467b97STreehugger Robot
196*16467b97STreehugger Robot# Bad variable names which should always be refused, separated by a comma
197*16467b97STreehugger Robotbad-names=foo,bar,baz,toto,tutu,tata
198*16467b97STreehugger Robot
199*16467b97STreehugger Robot# List of builtins function names that should not be used, separated by a comma
200*16467b97STreehugger Robotbad-functions=map,filter,apply,input
201*16467b97STreehugger Robot
202*16467b97STreehugger Robot
203*16467b97STreehugger Robot# checks for sign of poor/misdesign:
204*16467b97STreehugger Robot# * number of methods, attributes, local variables...
205*16467b97STreehugger Robot# * size, complexity of functions, methods
206*16467b97STreehugger Robot#
207*16467b97STreehugger Robot[DESIGN]
208*16467b97STreehugger Robot
209*16467b97STreehugger Robot# Maximum number of arguments for function / method
210*16467b97STreehugger Robotmax-args=5
211*16467b97STreehugger Robot
212*16467b97STreehugger Robot# Maximum number of locals for function / method body
213*16467b97STreehugger Robotmax-locals=15
214*16467b97STreehugger Robot
215*16467b97STreehugger Robot# Maximum number of return / yield for function / method body
216*16467b97STreehugger Robotmax-returns=6
217*16467b97STreehugger Robot
218*16467b97STreehugger Robot# Maximum number of branch for function / method body
219*16467b97STreehugger Robotmax-branchs=12
220*16467b97STreehugger Robot
221*16467b97STreehugger Robot# Maximum number of statements in function / method body
222*16467b97STreehugger Robotmax-statements=50
223*16467b97STreehugger Robot
224*16467b97STreehugger Robot# Maximum number of parents for a class (see R0901).
225*16467b97STreehugger Robotmax-parents=7
226*16467b97STreehugger Robot
227*16467b97STreehugger Robot# Maximum number of attributes for a class (see R0902).
228*16467b97STreehugger Robotmax-attributes=7
229*16467b97STreehugger Robot
230*16467b97STreehugger Robot# Minimum number of public methods for a class (see R0903).
231*16467b97STreehugger Robotmin-public-methods=2
232*16467b97STreehugger Robot
233*16467b97STreehugger Robot# Maximum number of public methods for a class (see R0904).
234*16467b97STreehugger Robotmax-public-methods=20
235*16467b97STreehugger Robot
236*16467b97STreehugger Robot
237*16467b97STreehugger Robot# checks for :
238*16467b97STreehugger Robot# * methods without self as first argument
239*16467b97STreehugger Robot# * overridden methods signature
240*16467b97STreehugger Robot# * access only to existant members via self
241*16467b97STreehugger Robot# * attributes not defined in the __init__ method
242*16467b97STreehugger Robot# * supported interfaces implementation
243*16467b97STreehugger Robot# * unreachable code
244*16467b97STreehugger Robot#
245*16467b97STreehugger Robot[CLASSES]
246*16467b97STreehugger Robot
247*16467b97STreehugger Robot# List of interface methods to ignore, separated by a comma. This is used for
248*16467b97STreehugger Robot# instance to not check methods defines in Zope's Interface base class.
249*16467b97STreehugger Robotignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
250*16467b97STreehugger Robot
251*16467b97STreehugger Robot# List of method names used to declare (i.e. assign) instance attributes.
252*16467b97STreehugger Robotdefining-attr-methods=__init__,__new__,setUp
253*16467b97STreehugger Robot
254*16467b97STreehugger Robot
255*16467b97STreehugger Robot# checks for
256*16467b97STreehugger Robot# * external modules dependencies
257*16467b97STreehugger Robot# * relative / wildcard imports
258*16467b97STreehugger Robot# * cyclic imports
259*16467b97STreehugger Robot# * uses of deprecated modules
260*16467b97STreehugger Robot#
261*16467b97STreehugger Robot[IMPORTS]
262*16467b97STreehugger Robot
263*16467b97STreehugger Robot# Deprecated modules which should not be used, separated by a comma
264*16467b97STreehugger Robotdeprecated-modules=regsub,string,TERMIOS,Bastion,rexec
265*16467b97STreehugger Robot
266*16467b97STreehugger Robot# Create a graph of every (i.e. internal and external) dependencies in the
267*16467b97STreehugger Robot# given file (report R0402 must not be disabled)
268*16467b97STreehugger Robotimport-graph=
269*16467b97STreehugger Robot
270*16467b97STreehugger Robot# Create a graph of external dependencies in the given file (report R0402 must
271*16467b97STreehugger Robot# not be disabled)
272*16467b97STreehugger Robotext-import-graph=
273*16467b97STreehugger Robot
274*16467b97STreehugger Robot# Create a graph of internal dependencies in the given file (report R0402 must
275*16467b97STreehugger Robot# not be disabled)
276*16467b97STreehugger Robotint-import-graph=
277*16467b97STreehugger Robot
278*16467b97STreehugger Robot
279*16467b97STreehugger Robot# checks for similarities and duplicated code. This computation may be
280*16467b97STreehugger Robot# memory / CPU intensive, so you should disable it if you experiments some
281*16467b97STreehugger Robot# problems.
282*16467b97STreehugger Robot#
283*16467b97STreehugger Robot[SIMILARITIES]
284*16467b97STreehugger Robot
285*16467b97STreehugger Robot# Minimum lines number of a similarity.
286*16467b97STreehugger Robotmin-similarity-lines=4
287*16467b97STreehugger Robot
288*16467b97STreehugger Robot# Ignore comments when computing similarities.
289*16467b97STreehugger Robotignore-comments=yes
290*16467b97STreehugger Robot
291*16467b97STreehugger Robot# Ignore docstrings when computing similarities.
292*16467b97STreehugger Robotignore-docstrings=yes
293*16467b97STreehugger Robot
294*16467b97STreehugger Robot
295*16467b97STreehugger Robot# checks for :
296*16467b97STreehugger Robot# * unauthorized constructions
297*16467b97STreehugger Robot# * strict indentation
298*16467b97STreehugger Robot# * line length
299*16467b97STreehugger Robot# * use of <> instead of !=
300*16467b97STreehugger Robot#
301*16467b97STreehugger Robot[FORMAT]
302*16467b97STreehugger Robot
303*16467b97STreehugger Robot# Maximum number of characters on a single line.
304*16467b97STreehugger Robotmax-line-length=80
305*16467b97STreehugger Robot
306*16467b97STreehugger Robot# Maximum number of lines in a module
307*16467b97STreehugger Robotmax-module-lines=1000
308*16467b97STreehugger Robot
309*16467b97STreehugger Robot# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
310*16467b97STreehugger Robot# tab).
311*16467b97STreehugger Robotindent-string='    '
312*16467b97STreehugger Robot
313*16467b97STreehugger Robot
314*16467b97STreehugger Robot# checks for:
315*16467b97STreehugger Robot# * warning notes in the code like FIXME, XXX
316*16467b97STreehugger Robot# * PEP 263: source code with non ascii character but no encoding declaration
317*16467b97STreehugger Robot#
318*16467b97STreehugger Robot[MISCELLANEOUS]
319*16467b97STreehugger Robot
320*16467b97STreehugger Robot# List of note tags to take in consideration, separated by a comma.
321*16467b97STreehugger Robotnotes=FIXME,XXX,TODO
322