kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 1 | # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | |
| 9 | # This file is mostly based on the contents of |
| 10 | # https://cs.chromium.org/chromium/tools/depot_tools/pylintrc |
| 11 | # and (since the above doesn't properly support naming style checks) |
| 12 | # https://cs.chromium.org/chromium/src/third_party/chromite/pylintrc |
| 13 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 10:55:39 | [diff] [blame] | 14 | [MESSAGES CONTROL] |
| 15 | |
| 16 | # Disable the message, report, category or checker with the given id(s). |
| 17 | # TODO(kjellander): Reduce this list to as small as possible. |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 18 | disable= |
| 19 | E0611, |
| 20 | I0010, |
| 21 | I0011, |
| 22 | W0232, |
Artem Titov | 5d7a4c6 | 2018-07-23 11:58:25 | [diff] [blame] | 23 | C0413, |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 24 | bad-continuation, |
| 25 | broad-except, |
| 26 | duplicate-code, |
| 27 | eval-used, |
| 28 | exec-used, |
| 29 | fixme, |
| 30 | import-error, |
Christoffer Jansson | 4e8a773 | 2022-02-08 08:01:12 | [diff] [blame] | 31 | import-outside-toplevel, |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 32 | missing-docstring, |
| 33 | no-init, |
| 34 | no-member, |
| 35 | too-few-public-methods, |
| 36 | too-many-ancestors, |
| 37 | too-many-arguments, |
| 38 | too-many-branches, |
| 39 | too-many-function-args, |
| 40 | too-many-instance-attributes, |
| 41 | too-many-lines, |
| 42 | too-many-locals, |
| 43 | too-many-public-methods, |
| 44 | too-many-return-statements, |
| 45 | too-many-statements, |
Henrik Kjellander | 57e5fd2 | 2015-05-25 10:55:39 | [diff] [blame] | 46 | |
| 47 | |
| 48 | [REPORTS] |
| 49 | |
| 50 | # Don't write out full reports, just messages. |
| 51 | reports=no |
| 52 | |
| 53 | |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 54 | [VARIABLES] |
| 55 | |
| 56 | # Tells whether we should check for unused import in __init__ files. |
| 57 | init-import=no |
| 58 | |
| 59 | # A regular expression matching the beginning of the name of dummy variables |
| 60 | # (i.e. not used). |
| 61 | dummy-variables-rgx=_|dummy |
| 62 | |
| 63 | |
| 64 | [TYPECHECK] |
| 65 | |
| 66 | # Tells whether missing members accessed in mixin class should be ignored. A |
| 67 | # mixin class is detected if its name ends with "mixin" (case insensitive). |
| 68 | ignore-mixin-members=yes |
| 69 | |
| 70 | # List of classes names for which member attributes should not be checked |
| 71 | # (useful for classes with attributes dynamically set). |
| 72 | ignored-classes=hashlib,numpy |
| 73 | |
| 74 | |
| 75 | [MISCELLANEOUS] |
| 76 | |
| 77 | # List of note tags to take in consideration, separated by a comma. |
| 78 | notes=FIXME,XXX,TODO |
| 79 | |
| 80 | |
| 81 | [SIMILARITIES] |
| 82 | |
| 83 | # Minimum lines number of a similarity. |
| 84 | min-similarity-lines=4 |
| 85 | |
| 86 | # Ignore comments when computing similarities. |
| 87 | ignore-comments=yes |
| 88 | |
| 89 | # Ignore docstrings when computing similarities. |
| 90 | ignore-docstrings=yes |
| 91 | |
| 92 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 10:55:39 | [diff] [blame] | 93 | [FORMAT] |
| 94 | |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 95 | # Maximum number of characters on a single line. |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 96 | max-line-length=79 |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 97 | |
| 98 | # Maximum number of lines in a module |
| 99 | max-module-lines=1000 |
| 100 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 101 | # Use four spaces for indents. |
| 102 | indent-string=' ' |
Jeremy Leconte | f22c78b | 2021-12-07 18:49:48 | [diff] [blame] | 103 | |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 104 | |
| 105 | [BASIC] |
| 106 | |
| 107 | # List of builtins function names that should not be used, separated by a comma |
| 108 | bad-functions=map,filter,apply,input |
| 109 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 110 | # Naming style matching correct module names. |
| 111 | module-naming-style=snake_case |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 112 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 113 | # Naming style matching correct constant names. |
| 114 | const-naming-style=UPPER_CASE |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 115 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 116 | # Naming style matching correct class names. |
| 117 | class-naming-style=PascalCase |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 118 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 119 | # Naming style matching correct function names. |
| 120 | function-naming-style=snake_case |
Mirko Bonadei | 9012b09 | 2020-11-09 16:48:04 | [diff] [blame] | 121 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 122 | # Regular expression matching correct method names. |
| 123 | method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$ |
Mirko Bonadei | 9012b09 | 2020-11-09 16:48:04 | [diff] [blame] | 124 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 125 | # Naming style matching correct attribute names. |
| 126 | attr-naming-style=snake_case |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 127 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 128 | # Naming style matching correct argument names. |
| 129 | argument-naming-style=snake_case |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 130 | |
Emil Lundmark | 7892f05 | 2023-09-25 15:29:13 | [diff] [blame] | 131 | # Naming style matching correct variable names. |
| 132 | variable-naming-style=snake_case |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 133 | |
| 134 | # Regular expression which should only match correct list comprehension / |
| 135 | # generator expression variable names |
| 136 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
| 137 | |
| 138 | # Good variable names which should always be accepted, separated by a comma |
| 139 | good-names=i,j,k,ex,Run,_ |
| 140 | |
| 141 | # Bad variable names which should always be refused, separated by a comma |
| 142 | bad-names=foo,bar,baz,toto,tutu,tata |
| 143 | |
| 144 | # Regular expression which should only match functions or classes name which do |
| 145 | # not require a docstring |
| 146 | no-docstring-rgx=__.*__ |
| 147 | |
| 148 | |
| 149 | [DESIGN] |
| 150 | |
| 151 | # Maximum number of arguments for function / method |
| 152 | max-args=5 |
| 153 | |
| 154 | # Argument names that match this expression will be ignored. Default to name |
| 155 | # with leading underscore |
| 156 | ignored-argument-names=_.* |
| 157 | |
| 158 | # Maximum number of locals for function / method body |
| 159 | max-locals=15 |
| 160 | |
| 161 | # Maximum number of return / yield for function / method body |
| 162 | max-returns=6 |
| 163 | |
| 164 | # Maximum number of branch for function / method body |
| 165 | max-branchs=12 |
| 166 | |
| 167 | # Maximum number of statements in function / method body |
| 168 | max-statements=50 |
| 169 | |
| 170 | # Maximum number of parents for a class (see R0901). |
| 171 | max-parents=7 |
| 172 | |
| 173 | # Maximum number of attributes for a class (see R0902). |
| 174 | max-attributes=7 |
| 175 | |
| 176 | # Minimum number of public methods for a class (see R0903). |
| 177 | min-public-methods=2 |
| 178 | |
| 179 | # Maximum number of public methods for a class (see R0904). |
| 180 | max-public-methods=20 |
| 181 | |
| 182 | |
| 183 | [CLASSES] |
| 184 | |
kjellander | 38c65c8 | 2017-04-13 05:43:38 | [diff] [blame] | 185 | # List of method names used to declare (i.e. assign) instance attributes. |
| 186 | defining-attr-methods=__init__,__new__,setUp |
| 187 | |
| 188 | # List of valid names for the first argument in a class method. |
| 189 | valid-classmethod-first-arg=cls |
| 190 | |
| 191 | |
| 192 | [IMPORTS] |
| 193 | |
| 194 | # Deprecated modules which should not be used, separated by a comma |
| 195 | deprecated-modules=regsub,TERMIOS,Bastion,rexec |
| 196 | |
| 197 | |
| 198 | [EXCEPTIONS] |
| 199 | |
| 200 | # Exceptions that will emit a warning when being caught. Defaults to |
| 201 | # "Exception" |
| 202 | overgeneral-exceptions=Exception |