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