Craig Citro | 4572ff0 | 2015-05-01 09:14:07 -0700 | [diff] [blame^] | 1 | # PyLint config for apitools code. |
| 2 | # |
| 3 | # NOTES: |
| 4 | # |
| 5 | # - Rules for test / demo code are generated into 'pylintrc_reduced' |
| 6 | # as deltas from this configuration by the 'run_pylint.py' script. |
| 7 | # |
| 8 | # - 'RATIONALE: API mapping' as a defense for non-default settings is |
| 9 | # based on the fact that this library maps APIs which are outside our |
| 10 | # control, and adhering to the out-of-the-box defaults would induce |
| 11 | # breakage / complexity in those mappings |
| 12 | # |
| 13 | [MASTER] |
| 14 | |
| 15 | # Specify a configuration file. |
| 16 | # DEFAULT: rcfile= |
| 17 | |
| 18 | # Python code to execute, usually for sys.path manipulation such as |
| 19 | # pygtk.require(). |
| 20 | # DEFAULT: init-hook= |
| 21 | |
| 22 | # Profiled execution. |
| 23 | # DEFAULT: profile=no |
| 24 | |
| 25 | # Add files or directories to the blacklist. They should be base names, not |
| 26 | # paths. |
| 27 | # DEFAULT: ignore=CVS |
| 28 | # NOTE: This path must be relative due to the use of |
| 29 | # os.walk in astroid.modutils.get_module_files. |
| 30 | |
| 31 | # Pickle collected data for later comparisons. |
| 32 | # DEFAULT: persistent=yes |
| 33 | |
| 34 | # List of plugins (as comma separated values of python modules names) to load, |
| 35 | # usually to register additional checkers. |
| 36 | # DEFAULT: load-plugins= |
| 37 | |
| 38 | # DEPRECATED |
| 39 | # DEFAULT: include-ids=no |
| 40 | |
| 41 | # DEPRECATED |
| 42 | # DEFAULT: symbols=no |
| 43 | |
| 44 | |
| 45 | [MESSAGES CONTROL] |
| 46 | |
| 47 | disable = |
| 48 | fixme, |
| 49 | import-error, |
| 50 | locally-disabled, |
| 51 | locally-enabled, |
| 52 | maybe-no-member, |
| 53 | method-hidden, |
| 54 | no-init, |
| 55 | no-member, |
| 56 | no-self-use, |
| 57 | redefined-builtin, |
| 58 | similarities, |
| 59 | star-args, |
| 60 | super-on-old-class, |
| 61 | too-few-public-methods, |
| 62 | too-many-arguments, |
| 63 | too-many-branches, |
| 64 | too-many-instance-attributes, |
| 65 | too-many-locals, |
| 66 | too-many-public-methods, |
| 67 | too-many-return-statements, |
| 68 | too-many-statements, |
| 69 | |
| 70 | |
| 71 | [REPORTS] |
| 72 | |
| 73 | # Set the output format. Available formats are text, parseable, colorized, msvs |
| 74 | # (visual studio) and html. You can also give a reporter class, eg |
| 75 | # mypackage.mymodule.MyReporterClass. |
| 76 | # DEFAULT: output-format=text |
| 77 | |
| 78 | # Put messages in a separate file for each module / package specified on the |
| 79 | # command line instead of printing them on stdout. Reports (if any) will be |
| 80 | # written in a file name "pylint_global.[txt|html]". |
| 81 | # DEFAULT: files-output=no |
| 82 | |
| 83 | # Tells whether to display a full report or only the messages |
| 84 | # DEFAULT: reports=yes |
| 85 | # RATIONALE: run from Travis / tox, and don't need / want to parse output. |
| 86 | reports=no |
| 87 | |
| 88 | # Python expression which should return a note less than 10 (10 is the highest |
| 89 | # note). You have access to the variables errors warning, statement which |
| 90 | # respectively contain the number of errors / warnings messages and the total |
| 91 | # number of statements analyzed. This is used by the global evaluation report |
| 92 | # (RP0004). |
| 93 | # DEFAULT: evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) |
| 94 | |
| 95 | # Add a comment according to your evaluation note. This is used by the global |
| 96 | # evaluation report (RP0004). |
| 97 | # DEFAULT: comment=no |
| 98 | |
| 99 | # Template used to display messages. This is a python new-style format string |
| 100 | # used to format the message information. See doc for all details |
| 101 | #msg-template= |
| 102 | |
| 103 | |
| 104 | [SIMILARITIES] |
| 105 | |
| 106 | # Minimum lines number of a similarity. |
| 107 | # DEFAULT: min-similarity-lines=4 |
| 108 | |
| 109 | # Ignore comments when computing similarities. |
| 110 | # DEFAULT: ignore-comments=yes |
| 111 | |
| 112 | # Ignore docstrings when computing similarities. |
| 113 | # DEFAULT: ignore-docstrings=yes |
| 114 | |
| 115 | # Ignore imports when computing similarities. |
| 116 | # DEFAULT: ignore-imports=no |
| 117 | |
| 118 | |
| 119 | [VARIABLES] |
| 120 | |
| 121 | # Tells whether we should check for unused import in __init__ files. |
| 122 | # DEFAULT: init-import=no |
| 123 | |
| 124 | # A regular expression matching the name of dummy variables (i.e. expectedly |
| 125 | # not used). |
| 126 | dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_) |
| 127 | |
| 128 | |
| 129 | # List of additional names supposed to be defined in builtins. Remember that |
| 130 | # you should avoid to define new builtins when possible. |
| 131 | # DEFAULT: additional-builtins= |
| 132 | |
| 133 | |
| 134 | [LOGGING] |
| 135 | |
| 136 | # Logging modules to check that the string format arguments are in logging |
| 137 | # function parameter format |
| 138 | # DEFAULT: logging-modules=logging |
| 139 | |
| 140 | |
| 141 | [FORMAT] |
| 142 | |
| 143 | # Maximum number of characters on a single line. |
| 144 | # DEFAULT: max-line-length=80 |
| 145 | |
| 146 | # Regexp for a line that is allowed to be longer than the limit. |
| 147 | # DEFAULT: ignore-long-lines=^\s*(# )?<?https?://\S+>?$ |
| 148 | |
| 149 | # Allow the body of an if to be on the same line as the test if there is no |
| 150 | # else. |
| 151 | # DEFAULT: single-line-if-stmt=no |
| 152 | |
| 153 | # List of optional constructs for which whitespace checking is disabled |
| 154 | # DEFAULT: no-space-check=trailing-comma,dict-separator |
| 155 | # RATIONALE: pylint ignores whitespace checks around the |
| 156 | # constructs "dict-separator" (cases like {1:2}) and |
| 157 | # "trailing-comma" (cases like {1: 2, }). |
| 158 | # By setting "no-space-check" to empty whitespace checks will be |
| 159 | # enforced around both constructs. |
| 160 | no-space-check = |
| 161 | |
| 162 | # Maximum number of lines in a module |
| 163 | # DEFAULT: max-module-lines=1000 |
| 164 | max-module-lines=1500 |
| 165 | |
| 166 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
| 167 | # tab). |
| 168 | # DEFAULT: indent-string=' ' |
| 169 | |
| 170 | # Number of spaces of indent required inside a hanging or continued line. |
| 171 | # DEFAULT: indent-after-paren=4 |
| 172 | |
| 173 | |
| 174 | [MISCELLANEOUS] |
| 175 | |
| 176 | # List of note tags to take in consideration, separated by a comma. |
| 177 | # DEFAULT: notes=FIXME,XXX,TODO |
| 178 | |
| 179 | |
| 180 | [BASIC] |
| 181 | required-attributes= |
| 182 | |
| 183 | no-docstring-rgx=(__.*__|main) |
| 184 | |
| 185 | docstring-min-length=10 |
| 186 | |
| 187 | # Regular expression which should only match correct module names. The |
| 188 | # leading underscore is sanctioned for private modules by Google's style |
| 189 | # guide. |
| 190 | module-rgx=^(_?[a-z][a-z0-9_]*)|__init__$ |
| 191 | |
| 192 | # Regular expression which should only match correct module level names |
| 193 | const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 194 | |
| 195 | # Regular expression which should only match correct class attribute |
| 196 | class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 197 | |
| 198 | # Regular expression which should only match correct class names |
| 199 | class-rgx=^_?[A-Z][a-zA-Z0-9]*$ |
| 200 | |
| 201 | # Regular expression which should only match correct function names. |
| 202 | # 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 203 | # styles across functions and methods. |
| 204 | function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$ |
| 205 | |
| 206 | # Regular expression which should only match correct method names. |
| 207 | # 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 208 | # styles across functions and methods. 'exempt' indicates a name which is |
| 209 | # consistent with all naming styles. |
| 210 | method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$ |
| 211 | |
| 212 | # Regular expression which should only match correct instance attribute names |
| 213 | attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ |
| 214 | |
| 215 | # Regular expression which should only match correct argument names |
| 216 | argument-rgx=^[a-z][a-z0-9_]*$ |
| 217 | |
| 218 | # Regular expression which should only match correct variable names |
| 219 | variable-rgx=^[a-z][a-z0-9_]*$ |
| 220 | |
| 221 | # Regular expression which should only match correct list comprehension / |
| 222 | # generator expression variable names |
| 223 | inlinevar-rgx=^[a-z][a-z0-9_]*$ |
| 224 | |
| 225 | # Good variable names which should always be accepted, separated by a comma |
| 226 | good-names=main,_ |
| 227 | |
| 228 | # Bad variable names which should always be refused, separated by a comma |
| 229 | bad-names= |
| 230 | |
| 231 | # List of builtins function names that should not be used, separated by a comma |
| 232 | # <http://go/python-style#Deprecated_Language_Features> |
| 233 | bad-functions=input,apply,reduce |
| 234 | |
| 235 | # TEMPORARY |
| 236 | no-docstring-rgx=.* |
| 237 | |
| 238 | |
| 239 | [TYPECHECK] |
| 240 | |
| 241 | # Tells whether missing members accessed in mixin class should be ignored. A |
| 242 | # mixin class is detected if its name ends with "mixin" (case insensitive). |
| 243 | # DEFAULT: ignore-mixin-members=yes |
| 244 | |
| 245 | # List of module names for which member attributes should not be checked |
| 246 | # (useful for modules/projects where namespaces are manipulated during runtime |
| 247 | # and thus existing member attributes cannot be deduced by static analysis |
| 248 | # DEFAULT: ignored-modules= |
| 249 | |
| 250 | # List of classes names for which member attributes should not be checked |
| 251 | # (useful for classes with attributes dynamically set). |
| 252 | # DEFAULT: ignored-classes=SQLObject |
| 253 | |
| 254 | # When zope mode is activated, add a predefined set of Zope acquired attributes |
| 255 | # to generated-members. |
| 256 | # DEFAULT: zope=no |
| 257 | |
| 258 | # List of members which are set dynamically and missed by pylint inference |
| 259 | # system, and so shouldn't trigger E0201 when accessed. Python regular |
| 260 | # expressions are accepted. |
| 261 | # DEFAULT: generated-members=REQUEST,acl_users,aq_parent |
| 262 | |
| 263 | |
| 264 | [IMPORTS] |
| 265 | |
| 266 | # Deprecated modules which should not be used, separated by a comma |
| 267 | # DEFAULT: deprecated-modules=regsub,TERMIOS,Bastion,rexec |
| 268 | |
| 269 | # Create a graph of every (i.e. internal and external) dependencies in the |
| 270 | # given file (report RP0402 must not be disabled) |
| 271 | # DEFAULT: import-graph= |
| 272 | |
| 273 | # Create a graph of external dependencies in the given file (report RP0402 must |
| 274 | # not be disabled) |
| 275 | # DEFAULT: ext-import-graph= |
| 276 | |
| 277 | # Create a graph of internal dependencies in the given file (report RP0402 must |
| 278 | # not be disabled) |
| 279 | # DEFAULT: int-import-graph= |
| 280 | |
| 281 | |
| 282 | [CLASSES] |
| 283 | |
| 284 | # List of interface methods to ignore, separated by a comma. This is used for |
| 285 | # instance to not check methods defines in Zope's Interface base class. |
| 286 | # DEFAULT: ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by |
| 287 | |
| 288 | # List of method names used to declare (i.e. assign) instance attributes. |
| 289 | # DEFAULT: defining-attr-methods=__init__,__new__,setUp |
| 290 | |
| 291 | # List of valid names for the first argument in a class method. |
| 292 | # DEFAULT: valid-classmethod-first-arg=cls |
| 293 | |
| 294 | # List of valid names for the first argument in a metaclass class method. |
| 295 | # DEFAULT: valid-metaclass-classmethod-first-arg=mcs |
| 296 | |
| 297 | |
| 298 | [DESIGN] |
| 299 | |
| 300 | # Maximum number of arguments for function / method |
| 301 | # DEFAULT: max-args=5 |
| 302 | # RATIONALE: API-mapping |
| 303 | max-args = 10 |
| 304 | |
| 305 | # Argument names that match this expression will be ignored. Default to name |
| 306 | # with leading underscore |
| 307 | # DEFAULT: ignored-argument-names=_.* |
| 308 | |
| 309 | # Maximum number of locals for function / method body |
| 310 | # DEFAULT: max-locals=15 |
| 311 | max-locals=20 |
| 312 | |
| 313 | # Maximum number of return / yield for function / method body |
| 314 | # DEFAULT: max-returns=6 |
| 315 | |
| 316 | # Maximum number of branch for function / method body |
| 317 | # DEFAULT: max-branches=12 |
| 318 | |
| 319 | # Maximum number of statements in function / method body |
| 320 | # DEFAULT: max-statements=50 |
| 321 | |
| 322 | # Maximum number of parents for a class (see R0901). |
| 323 | # DEFAULT: max-parents=7 |
| 324 | |
| 325 | # Maximum number of attributes for a class (see R0902). |
| 326 | # DEFAULT: max-attributes=7 |
| 327 | # RATIONALE: API mapping |
| 328 | max-attributes=15 |
| 329 | |
| 330 | # Minimum number of public methods for a class (see R0903). |
| 331 | # DEFAULT: min-public-methods=2 |
| 332 | # RATIONALE: context mgrs may have *no* public methods |
| 333 | min-public-methods=0 |
| 334 | |
| 335 | # Maximum number of public methods for a class (see R0904). |
| 336 | # DEFAULT: max-public-methods=20 |
| 337 | # RATIONALE: API mapping |
| 338 | max-public-methods=40 |
| 339 | |
| 340 | |
| 341 | [EXCEPTIONS] |
| 342 | |
| 343 | # Exceptions that will emit a warning when being caught. Defaults to |
| 344 | # "Exception" |
| 345 | # DEFAULT: overgeneral-exceptions=Exception |