| 1 |
# Copyright 2016 Google Inc. All rights reserved. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
[REPORTS] |
| 16 |
|
| 17 |
# Put messages in a separate file for each module / package specified on the |
| 18 |
# command line instead of printing them on stdout. Reports (if any) will be |
| 19 |
# written in a file name "pylint_global.[txt|html]". |
| 20 |
files-output=no |
| 21 |
|
| 22 |
# Tells whether to display a full report or only the messages. |
| 23 |
reports=no |
| 24 |
|
| 25 |
# Disable the report(s) with the given id(s). |
| 26 |
disable-report=R0001,R0002,R0003,R0004,R0101,R0102,R0201,R0202,R0220,R0401,R0402,R0701,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,R0923 |
| 27 |
|
| 28 |
|
| 29 |
[MESSAGES CONTROL] |
| 30 |
# List of checkers and warnings to enable. |
| 31 |
enable=old-raise-syntax |
| 32 |
|
| 33 |
# List of checkers and warnings to disable. |
| 34 |
disable=abstract-method,access-member-before-definition,arguments-differ,attribute-defined-outside-init,bad-option-value,design,file-ignored,fixme,global-statement,import-error,interface-is-not-class,locally-disabled,locally-enabled,maybe-no-member,method-hidden,missing-interface-method,no-init,no-member,no-name-in-module,no-self-use,pointless-except,relative-import,signature-differs,similarities,star-args,suppressed-message,unresolved-interface,unused-wildcard-import,useless-suppression |
| 35 |
|
| 36 |
confidence=HIGH,INFERENCE,UNDEFINED |
| 37 |
|
| 38 |
|
| 39 |
[BASIC] |
| 40 |
|
| 41 |
# Regular expression which should only match the name |
| 42 |
# of functions or classes which do not require a docstring. |
| 43 |
no-docstring-rgx=(__.*__|main) |
| 44 |
|
| 45 |
# Min length in lines of a function that requires a docstring. |
| 46 |
docstring-min-length=10 |
| 47 |
|
| 48 |
# Regular expression which should only match correct module names. The |
| 49 |
# leading underscore is sanctioned for private modules by Google's style |
| 50 |
# guide. |
| 51 |
# |
| 52 |
# There are exceptions to the basic rule (_?[a-z][a-z0-9_]*) to cover |
| 53 |
# requirements of Python's module system and of the presubmit framework. |
| 54 |
module-rgx=^(_?[a-z][a-z0-9_]*)|__init__|PRESUBMIT|PRESUBMIT_unittest$ |
| 55 |
|
| 56 |
# Regular expression which should only match correct module level names |
| 57 |
const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 58 |
|
| 59 |
# Regular expression which should only match correct class attribute |
| 60 |
class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 61 |
|
| 62 |
# Regular expression which should only match correct class names |
| 63 |
class-rgx=^_?[A-Z][a-zA-Z0-9]*$ |
| 64 |
|
| 65 |
# Regular expression which should only match correct function names. |
| 66 |
# 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 67 |
# styles across functions and methods. |
| 68 |
function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$ |
| 69 |
|
| 70 |
# Regular expression which should only match correct method names. |
| 71 |
# 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 72 |
# styles across functions and methods. 'exempt' indicates a name which is |
| 73 |
# consistent with all naming styles. |
| 74 |
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_]*))$ |
| 75 |
|
| 76 |
# Regular expression which should only match correct instance attribute names |
| 77 |
attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ |
| 78 |
|
| 79 |
# Regular expression which should only match correct argument names |
| 80 |
argument-rgx=^[a-z][a-z0-9_]*$ |
| 81 |
|
| 82 |
# Regular expression which should only match correct variable names |
| 83 |
variable-rgx=^[a-z][a-z0-9_]*$ |
| 84 |
|
| 85 |
# Regular expression which should only match correct list comprehension / |
| 86 |
# generator expression variable names |
| 87 |
inlinevar-rgx=^[a-z][a-z0-9_]*$ |
| 88 |
|
| 89 |
# Good variable names which should always be accepted, separated by a comma |
| 90 |
good-names=main,_ |
| 91 |
|
| 92 |
# Bad variable names which should always be refused, separated by a comma |
| 93 |
bad-names= |
| 94 |
|
| 95 |
# List of builtins function names that should not be used, separated by a comma |
| 96 |
# <https://google.github.io/styleguide/pyguide.html?showone=Deprecated_Language_Features#Deprecated_Language_Features> |
| 97 |
# TODO(robankeny) is this a valid function to leave in or remove? |
| 98 |
bad-functions=input,apply,reduce |
| 99 |
|
| 100 |
# List of decorators that define properties, such as abc.abstractproperty. |
| 101 |
property-classes=abc.abstractproperty |
| 102 |
|
| 103 |
|
| 104 |
[TYPECHECK] |
| 105 |
|
| 106 |
# Tells whether missing members accessed in mixin class should be ignored. A |
| 107 |
# mixin class is detected if its name ends with "mixin" (case insensitive). |
| 108 |
ignore-mixin-members=yes |
| 109 |
|
| 110 |
# List of decorators that create context managers from functions, such as |
| 111 |
# contextlib.contextmanager. |
| 112 |
contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager |
| 113 |
|
| 114 |
|
| 115 |
[VARIABLES] |
| 116 |
|
| 117 |
# Tells whether we should check for unused import in __init__ files. |
| 118 |
init-import=no |
| 119 |
|
| 120 |
# A regular expression matching names used for dummy variables (i.e. not used). |
| 121 |
dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_) |
| 122 |
|
| 123 |
# List of additional names supposed to be defined in builtins. Remember that |
| 124 |
# you should avoid to define new builtins when possible. |
| 125 |
additional-builtins= |
| 126 |
|
| 127 |
|
| 128 |
[CLASSES] |
| 129 |
|
| 130 |
# List of method names used to declare (i.e. assign) instance attributes. |
| 131 |
defining-attr-methods=__init__,__new__,setUp |
| 132 |
|
| 133 |
# List of valid names for the first argument in a class method. |
| 134 |
valid-classmethod-first-arg=cls |
| 135 |
|
| 136 |
|
| 137 |
[EXCEPTIONS] |
| 138 |
|
| 139 |
overgeneral-exceptions=StandardError,Exception,BaseException |
| 140 |
|
| 141 |
|
| 142 |
[IMPORTS] |
| 143 |
|
| 144 |
# Deprecated modules which should not be used, separated by a comma. |
| 145 |
# Many of the functions in the string module are deprecated in |
| 146 |
# favor of string methods, but there are non-deprecated things in that module |
| 147 |
# too. |
| 148 |
deprecated-modules=regsub,TERMIOS,Bastion,rexec |
| 149 |
|
| 150 |
|
| 151 |
[FORMAT] |
| 152 |
|
| 153 |
# Maximum number of characters on a single line. |
| 154 |
max-line-length=80 |
| 155 |
|
| 156 |
# Regexp for a line that is allowed to be longer than the limit. |
| 157 |
# This "ignore" regex is today composed of 4 independent parts: |
| 158 |
# (1) Long import lines |
| 159 |
# (2) p4 expansion $Id$ lines |
| 160 |
# (3) URLs in comments or pydocs. Detecting URLs by regex is a hard problem and |
| 161 |
# no amount of tweaking will make a perfect regex AFAICT. This one is a good |
| 162 |
# compromise. |
| 163 |
# (4) Constant string literals at the start of files don't need to be broken |
| 164 |
# across lines. Allowing long paths, streamz and urls to be on a single |
| 165 |
# line. Also requires that the string not be a triplequoted string. |
| 166 |
ignore-long-lines=(?x) |
| 167 |
(^\s*(import|from)\s |
| 168 |
|\$Id:\s\/\/depot\/.+#\d+\s\$ |
| 169 |
|^\s*(\#\ )?<?(https?|ftp):\/\/[^\s\/$.?#].[^\s]*>?$ |
| 170 |
|^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+') |
| 171 |
) |
| 172 |
|
| 173 |
# Maximum number of lines in a module |
| 174 |
max-module-lines=99999 |
| 175 |
|
| 176 |
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 |
| 177 |
# tab). |
| 178 |
indent-string=' ' |
| 179 |
|
| 180 |
# Do not warn about multiple statements on a single line for constructs like |
| 181 |
# if test: stmt |
| 182 |
single-line-if-stmt=y |
| 183 |
|
| 184 |
# Make sure : in dicts and trailing commas are checked for whitespace. |
| 185 |
no-space-check= |
| 186 |
|
| 187 |
|
| 188 |
[LOGGING] |
| 189 |
|
| 190 |
logging-modules=logging |
| 191 |
|
| 192 |
|
| 193 |
[MISCELLANEOUS] |
| 194 |
|
| 195 |
# List of note tags to take in consideration, separated by a comma. |
| 196 |
notes= |