Alexandru M Stan | fb5b5ee | 2014-12-04 13:32:55 -0800 | [diff] [blame] | 1 | # 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 Frysinger | f80ca21 | 2018-07-13 15:02:52 -0400 | [diff] [blame] | 5 | [MASTER] |
| 6 | |
| 7 | load-plugins=chromite.cli.cros.lint |
| 8 | |
Mike Frysinger | 87f315a | 2019-08-07 16:16:37 -0400 | [diff] [blame] | 9 | # Configure quote preferences. |
| 10 | string-quote = single-avoid-escape |
| 11 | triple-quote = double |
| 12 | docstring-quote = double |
| 13 | |
Alexandru M Stan | fb5b5ee | 2014-12-04 13:32:55 -0800 | [diff] [blame] | 14 | [MESSAGES CONTROL] |
| 15 | |
Mike Frysinger | 87f315a | 2019-08-07 16:16:37 -0400 | [diff] [blame] | 16 | enable= |
| 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 Stan | fb5b5ee | 2014-12-04 13:32:55 -0800 | [diff] [blame] | 73 | disable= |
| 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. |
| 92 | reports=no |
| 93 | |
| 94 | |
Mike Frysinger | a52c5a6 | 2020-08-11 17:19:48 -0400 | [diff] [blame] | 95 | [FORMAT] |
| 96 | |
| 97 | # Maximum number of characters on a single line. |
| 98 | max-line-length=80 |
| 99 | |
| 100 | |
Alexandru M Stan | fb5b5ee | 2014-12-04 13:32:55 -0800 | [diff] [blame] | 101 | [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. |
| 107 | generated-members=REQUEST,acl_users,aq_parent,AndReturn,InAnyOrder,MultipleTimes,tempdir |
| 108 | |
| 109 | |
| 110 | [BASIC] |
| 111 | |
Mike Frysinger | 87f315a | 2019-08-07 16:16:37 -0400 | [diff] [blame] | 112 | # 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 |
| 115 | bad-functions= |
| 116 | apply, |
| 117 | exit, |
| 118 | filter, |
| 119 | input, |
| 120 | map, |
| 121 | quit, |
| 122 | raw_input, |
| 123 | reduce, |
| 124 | |
Alexandru M Stan | fb5b5ee | 2014-12-04 13:32:55 -0800 | [diff] [blame] | 125 | # 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 |
| 132 | function-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. |
| 144 | method-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. |
| 150 | min-similarity-lines=8 |
Mike Frysinger | f80ca21 | 2018-07-13 15:02:52 -0400 | [diff] [blame] | 151 | |
| 152 | |
| 153 | [IMPORTS] |
| 154 | |
Mike Frysinger | 87f315a | 2019-08-07 16:16:37 -0400 | [diff] [blame] | 155 | # 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. |
| 162 | deprecated-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. |
| 174 | logging-modules= |
| 175 | logging, |