blob: 958413cd29b586cfaf0db7ce8160c07e344b6d90 [file] [log] [blame]
Alexandru M Stanfb5b5ee2014-12-04 13:32:55 -08001# Copyright 2017 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Mike Frysingerf80ca212018-07-13 15:02:52 -04005[MASTER]
6
7load-plugins=chromite.cli.cros.lint
8
Mike Frysinger87f315a2019-08-07 16:16:37 -04009# Configure quote preferences.
10string-quote = single-avoid-escape
11triple-quote = double
12docstring-quote = double
13
Alexandru M Stanfb5b5ee2014-12-04 13:32:55 -080014[MESSAGES CONTROL]
15
Mike Frysinger87f315a2019-08-07 16:16:37 -040016enable=
17 apply-builtin,
18 backtick,
19 bad-python3-import,
20 buffer-builtin,
21 cmp-builtin,
22 cmp-method,
23 coerce-builtin,
24 coerce-method,
25 delslice-method,
26 deprecated-itertools-function,
27 deprecated-str-translate-call,
28 deprecated-string-function,
29 deprecated-types-field,
30 dict-items-not-iterating,
31 dict-iter-method,
32 dict-keys-not-iterating,
33 dict-values-not-iterating,
34 dict-view-method,
35 div-method,
36 exception-message-attribute,
37 execfile-builtin,
38 file-builtin,
39 filter-builtin-not-iterating,
40 getslice-method,
41 hex-method,
42 idiv-method,
43 import-star-module-level,
44 indexing-exception,
45 input-builtin,
46 intern-builtin,
47 invalid-str-codec,
48 long-builtin,
49 map-builtin-not-iterating,
50 metaclass-assignment,
51 next-method-called,
52 next-method-defined,
53 nonzero-method,
54 oct-method,
55 old-raise-syntax,
56 parameter-unpacking,
57 print-statement,
58 raising-string,
59 range-builtin-not-iterating,
60 raw_input-builtin,
61 rdiv-method,
62 reduce-builtin,
63 reload-builtin,
64 setslice-method,
65 standarderror-builtin,
66 sys-max-int,
67 unichr-builtin,
68 unpacking-in-except,
69 using-cmp-argument,
70 xrange-builtin,
71 zip-builtin-not-iterating,
72
Alexandru M Stanfb5b5ee2014-12-04 13:32:55 -080073disable=
74 too-many-lines,
75 too-many-branches,
76 too-many-statements,
77 too-few-public-methods,
78 too-many-instance-attributes,
79 too-many-public-methods,
80 too-many-locals,
81 too-many-arguments,
82 locally-enabled,
83 locally-disabled,
84 fixme,
85 bad-continuation,
86 invalid-name,
87
88[REPORTS]
89
90# Tells whether to display a full report or only the messages
91# CHANGE: No report.
92reports=no
93
94
Mike Frysingera52c5a62020-08-11 17:19:48 -040095[FORMAT]
96
97# Maximum number of characters on a single line.
98max-line-length=80
99
100
Alexandru M Stanfb5b5ee2014-12-04 13:32:55 -0800101[TYPECHECK]
102
103# List of members which are set dynamically and missed by pylint inference
104# system, and so shouldn't trigger E0201 when accessed.
105# CHANGE: Added 'AndReturn', 'InAnyOrder' and 'MultipleTimes' for pymox.
106# CHANGE: Added tempdir for @osutils.TempDirDecorator.
107generated-members=REQUEST,acl_users,aq_parent,AndReturn,InAnyOrder,MultipleTimes,tempdir
108
109
110[BASIC]
111
Mike Frysinger87f315a2019-08-07 16:16:37 -0400112# List of builtins function names that should not be used, separated by a comma.
113# exit & quit are for the interactive interpreter shell only.
114# https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module
115bad-functions=
116 apply,
117 exit,
118 filter,
119 input,
120 map,
121 quit,
122 raw_input,
123 reduce,
124
Alexandru M Stanfb5b5ee2014-12-04 13:32:55 -0800125# Regular expression which should only match correct function names
126#
127# CHANGE: The ChromiumOS standard is different than PEP-8, so we need to
128# redefine this.
129#
130# Common exceptions to ChromiumOS standard:
131# - main: Standard for main function
132function-rgx=([A-Z_][a-zA-Z0-9]{2,30}|main)$
133
134# Regular expression which should only match correct method names
135#
136# CHANGE: The ChromiumOS standard is different than PEP-8, so we need to
137# redefine this. Here's what we allow:
138# - CamelCaps, starting with a capital letter. No underscores in function
139# names. Can also have a "_" prefix (private method) or a "test" prefix
140# (unit test).
141# - Methods that look like __xyz__, which are used to do things like
142# __init__, __del__, etc.
143# - setUp, tearDown: For unit tests.
144method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,30}|__[a-z]+__|setUp|tearDown)$
145
146
147[SIMILARITIES]
148
149# Minimum lines number of a similarity.
150min-similarity-lines=8
Mike Frysingerf80ca212018-07-13 15:02:52 -0400151
152
153[IMPORTS]
154
Mike Frysinger87f315a2019-08-07 16:16:37 -0400155# Deprecated modules which should not be used, separated by a comma.
156# Bastion: Dropped in Python 3.
157# mox: Use the 'mock' module instead.
158# optparse: Use the 'argparse' module instead.
159# regsub: Use the 're' module instead.
160# rexec: Dropped in Python 3.
161# TERMIOS: Use the 'termios' module instead.
162deprecated-modules=
163 Bastion,
164 mox,
165 optparse,
166 regsub,
167 rexec,
168 TERMIOS,
169
170
171[LOGGING]
172
173# Apply logging string format checks to calls on these modules.
174logging-modules=
175 logging,