kjellander | 38c65c8 | 2017-04-12 22:43:38 -0700 | [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 12:55:39 +0200 | [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-12 22:43:38 -0700 | [diff] [blame] | 18 | disable= |
| 19 | E0611, |
| 20 | I0010, |
| 21 | I0011, |
| 22 | W0232, |
Artem Titov | 5d7a4c6 | 2018-07-23 13:58:25 +0200 | [diff] [blame] | 23 | C0413, |
kjellander | 38c65c8 | 2017-04-12 22:43:38 -0700 | [diff] [blame] | 24 | bad-continuation, |
| 25 | broad-except, |
| 26 | duplicate-code, |
| 27 | eval-used, |
| 28 | exec-used, |
| 29 | fixme, |
| 30 | import-error, |
| 31 | missing-docstring, |
| 32 | no-init, |
| 33 | no-member, |
| 34 | too-few-public-methods, |
| 35 | too-many-ancestors, |
| 36 | too-many-arguments, |
| 37 | too-many-branches, |
| 38 | too-many-function-args, |
| 39 | too-many-instance-attributes, |
| 40 | too-many-lines, |
| 41 | too-many-locals, |
| 42 | too-many-public-methods, |
| 43 | too-many-return-statements, |
| 44 | too-many-statements, |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 45 | |
| 46 | |
| 47 | [REPORTS] |
| 48 | |
| 49 | # Don't write out full reports, just messages. |
| 50 | reports=no |
| 51 | |
| 52 | |
kjellander | 38c65c8 | 2017-04-12 22:43:38 -0700 | [diff] [blame] | 53 | [VARIABLES] |
| 54 | |
| 55 | # Tells whether we should check for unused import in __init__ files. |
| 56 | init-import=no |
| 57 | |
| 58 | # A regular expression matching the beginning of the name of dummy variables |
| 59 | # (i.e. not used). |
| 60 | dummy-variables-rgx=_|dummy |
| 61 | |
| 62 | |
| 63 | [TYPECHECK] |
| 64 | |
| 65 | # Tells whether missing members accessed in mixin class should be ignored. A |
| 66 | # mixin class is detected if its name ends with "mixin" (case insensitive). |
| 67 | ignore-mixin-members=yes |
| 68 | |
| 69 | # List of classes names for which member attributes should not be checked |
| 70 | # (useful for classes with attributes dynamically set). |
| 71 | ignored-classes=hashlib,numpy |
| 72 | |
| 73 | |
| 74 | [MISCELLANEOUS] |
| 75 | |
| 76 | # List of note tags to take in consideration, separated by a comma. |
| 77 | notes=FIXME,XXX,TODO |
| 78 | |
| 79 | |
| 80 | [SIMILARITIES] |
| 81 | |
| 82 | # Minimum lines number of a similarity. |
| 83 | min-similarity-lines=4 |
| 84 | |
| 85 | # Ignore comments when computing similarities. |
| 86 | ignore-comments=yes |
| 87 | |
| 88 | # Ignore docstrings when computing similarities. |
| 89 | ignore-docstrings=yes |
| 90 | |
| 91 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 92 | [FORMAT] |
| 93 | |
kjellander | 38c65c8 | 2017-04-12 22:43:38 -0700 | [diff] [blame] | 94 | # Maximum number of characters on a single line. |
| 95 | max-line-length=80 |
| 96 | |
| 97 | # Maximum number of lines in a module |
| 98 | max-module-lines=1000 |
| 99 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 100 | # We use two spaces for indents, instead of the usual four spaces or tab. |
| 101 | indent-string=' ' |
kjellander | 38c65c8 | 2017-04-12 22:43:38 -0700 | [diff] [blame] | 102 | |
| 103 | |
| 104 | [BASIC] |
| 105 | |
| 106 | # List of builtins function names that should not be used, separated by a comma |
| 107 | bad-functions=map,filter,apply,input |
| 108 | |
| 109 | # Regular expression which should only match correct module names |
| 110 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ |
| 111 | |
| 112 | # Regular expression which should only match correct module level names |
| 113 | # (CAPS_WITH_UNDER) |
| 114 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ |
| 115 | |
| 116 | # Regular expression which should only match correct class names |
| 117 | # (CapWords) |
| 118 | class-rgx=[A-Z_][a-zA-Z0-9]+$ |
| 119 | |
| 120 | # Regular expression which should only match correct function names |
| 121 | # The Chromium standard is different than PEP-8, so we need to redefine this to |
| 122 | # only allow: |
| 123 | # - CapWords |
| 124 | # - main: Standard for main function. |
| 125 | function-rgx=([A-Z_][a-zA-Z0-9]{2,60}|main)$ |
| 126 | |
| 127 | # Regular expression which should only match correct method names |
| 128 | # The Chromium standard is different than PEP-8, so we need to redefine this to |
| 129 | # only allow: |
| 130 | # - CapWords, starting with a capital letter. No underscores in function |
| 131 | # names. Can also have a "_" prefix (private method) or a "test" prefix |
| 132 | # (unit test). |
| 133 | # - Methods that look like __xyz__, which are used to do things like |
| 134 | # __init__, __del__, etc. |
| 135 | # - setUp, tearDown: For unit tests. |
| 136 | method-rgx=((_|test)?[A-Z][a-zA-Z0-9]{2,60}|__[a-z]+__|setUp|tearDown)$ |
| 137 | |
| 138 | # Regular expression which should only match correct instance attribute names |
| 139 | attr-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 140 | |
| 141 | # Regular expression which should only match correct argument names |
| 142 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ |
| 143 | |
| 144 | # Regular expression which should only match correct variable names |
| 145 | variable-rgx=[a-z_][a-z0-9_]{0,30}$ |
| 146 | |
| 147 | # Regular expression which should only match correct list comprehension / |
| 148 | # generator expression variable names |
| 149 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ |
| 150 | |
| 151 | # Good variable names which should always be accepted, separated by a comma |
| 152 | good-names=i,j,k,ex,Run,_ |
| 153 | |
| 154 | # Bad variable names which should always be refused, separated by a comma |
| 155 | bad-names=foo,bar,baz,toto,tutu,tata |
| 156 | |
| 157 | # Regular expression which should only match functions or classes name which do |
| 158 | # not require a docstring |
| 159 | no-docstring-rgx=__.*__ |
| 160 | |
| 161 | |
| 162 | [DESIGN] |
| 163 | |
| 164 | # Maximum number of arguments for function / method |
| 165 | max-args=5 |
| 166 | |
| 167 | # Argument names that match this expression will be ignored. Default to name |
| 168 | # with leading underscore |
| 169 | ignored-argument-names=_.* |
| 170 | |
| 171 | # Maximum number of locals for function / method body |
| 172 | max-locals=15 |
| 173 | |
| 174 | # Maximum number of return / yield for function / method body |
| 175 | max-returns=6 |
| 176 | |
| 177 | # Maximum number of branch for function / method body |
| 178 | max-branchs=12 |
| 179 | |
| 180 | # Maximum number of statements in function / method body |
| 181 | max-statements=50 |
| 182 | |
| 183 | # Maximum number of parents for a class (see R0901). |
| 184 | max-parents=7 |
| 185 | |
| 186 | # Maximum number of attributes for a class (see R0902). |
| 187 | max-attributes=7 |
| 188 | |
| 189 | # Minimum number of public methods for a class (see R0903). |
| 190 | min-public-methods=2 |
| 191 | |
| 192 | # Maximum number of public methods for a class (see R0904). |
| 193 | max-public-methods=20 |
| 194 | |
| 195 | |
| 196 | [CLASSES] |
| 197 | |
| 198 | # List of interface methods to ignore, separated by a comma. This is used for |
| 199 | # instance to not check methods defines in Zope's Interface base class. |
| 200 | ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by |
| 201 | |
| 202 | # List of method names used to declare (i.e. assign) instance attributes. |
| 203 | defining-attr-methods=__init__,__new__,setUp |
| 204 | |
| 205 | # List of valid names for the first argument in a class method. |
| 206 | valid-classmethod-first-arg=cls |
| 207 | |
| 208 | |
| 209 | [IMPORTS] |
| 210 | |
| 211 | # Deprecated modules which should not be used, separated by a comma |
| 212 | deprecated-modules=regsub,TERMIOS,Bastion,rexec |
| 213 | |
| 214 | |
| 215 | [EXCEPTIONS] |
| 216 | |
| 217 | # Exceptions that will emit a warning when being caught. Defaults to |
| 218 | # "Exception" |
| 219 | overgeneral-exceptions=Exception |