summaryrefslogtreecommitdiff
path: root/.pylintrc
blob: 8e6c348a1e5f20bdfd7f21d6bbc47395e0c371c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

[MASTER]

load-plugins=chromite.cli.cros.lint

# Configure quote preferences.
string-quote = single-avoid-escape
triple-quote = double
docstring-quote = double
max-line-length = 80

[MESSAGES CONTROL]

enable=
    apply-builtin,
    backtick,
    bad-python3-import,
    buffer-builtin,
    cmp-builtin,
    cmp-method,
    coerce-builtin,
    coerce-method,
    delslice-method,
    deprecated-itertools-function,
    deprecated-str-translate-call,
    deprecated-string-function,
    deprecated-types-field,
    dict-items-not-iterating,
    dict-iter-method,
    dict-keys-not-iterating,
    dict-values-not-iterating,
    dict-view-method,
    div-method,
    exception-message-attribute,
    execfile-builtin,
    file-builtin,
    filter-builtin-not-iterating,
    getslice-method,
    hex-method,
    idiv-method,
    import-star-module-level,
    indexing-exception,
    input-builtin,
    intern-builtin,
    invalid-str-codec,
    long-builtin,
    map-builtin-not-iterating,
    metaclass-assignment,
    next-method-called,
    next-method-defined,
    nonzero-method,
    oct-method,
    old-raise-syntax,
    parameter-unpacking,
    print-statement,
    raising-string,
    range-builtin-not-iterating,
    raw_input-builtin,
    rdiv-method,
    reduce-builtin,
    reload-builtin,
    setslice-method,
    standarderror-builtin,
    sys-max-int,
    unichr-builtin,
    unpacking-in-except,
    using-cmp-argument,
    xrange-builtin,
    zip-builtin-not-iterating,

disable=
    bad-continuation,
    fixme,
    invalid-name,
    locally-disabled,
    locally-enabled,
    missing-print-function,
    too-few-public-methods,
    too-many-arguments,
    too-many-branches,
    too-many-instance-attributes,
    too-many-lines,
    too-many-locals,
    too-many-public-methods,
    too-many-statements,

[REPORTS]

# Tells whether to display a full report or only the messages
# CHANGE: No report.
reports=no


[TYPECHECK]

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed.
# CHANGE: Added 'AndReturn', 'InAnyOrder' and 'MultipleTimes' for pymox.
# CHANGE: Added tempdir for @osutils.TempDirDecorator.
generated-members=REQUEST,acl_users,aq_parent,AndReturn,InAnyOrder,MultipleTimes,tempdir


[BASIC]

# List of builtins function names that should not be used, separated by a comma.
# exit & quit are for the interactive interpreter shell only.
# https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module
bad-functions=
    apply,
    exit,
    filter,
    input,
    map,
    quit,
    raw_input,
    reduce,

# Regular expression which should only match correct function names
#
# CHANGE: The ChromiumOS standard is different than PEP-8, so we need to
# redefine this.
#
# Common exceptions to ChromiumOS standard:
# - main: Standard for main function
function-rgx=([A-Z_][a-zA-Z0-9]{2,30}|main)$

# Regular expression which should only match correct method names
#
# CHANGE: The ChromiumOS standard is different than PEP-8, so we need to
# redefine this. Here's what we allow:
# - CamelCaps, starting with a capital letter.  No underscores in function
#   names.  Can also have a "_" prefix (private method) or a "test" prefix
#   (unit test).
# - Methods that look like __xyz__, which are used to do things like
#   __init__, __del__, etc.
# - setUp, tearDown: For unit tests.
method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,30}|__[a-z]+__|setUp|tearDown)$


[SIMILARITIES]

# Minimum lines number of a similarity.
min-similarity-lines=8


[IMPORTS]

# Deprecated modules which should not be used, separated by a comma.
# Bastion: Dropped in Python 3.
# mox: Use the 'mock' module instead.
# optparse: Use the 'argparse' module instead.
# regsub: Use the 're' module instead.
# rexec: Dropped in Python 3.
# TERMIOS: Use the 'termios' module instead.
deprecated-modules=
    Bastion,
    mox,
    optparse,
    regsub,
    rexec,
    TERMIOS,


[LOGGING]

# Apply logging string format checks to calls on these modules.
logging-modules=
    logging,