|
| 1 | +[MESSAGES CONTROL] |
| 2 | + |
| 3 | +# List of checkers and warnings to enable. |
| 4 | +enable= |
| 5 | + indexing-exception, |
| 6 | + old-raise-syntax, |
| 7 | + |
| 8 | +# List of checkers and warnings to disable. |
| 9 | +# TODO: Shrink this list to as small as possible. |
| 10 | +disable= |
| 11 | + attribute-defined-outside-init, |
| 12 | + bad-option-value, |
| 13 | + bare-except, |
| 14 | + broad-except, |
| 15 | + c-extension-no-member, |
| 16 | + design, |
| 17 | + file-ignored, |
| 18 | + fixme, |
| 19 | + global-statement, |
| 20 | + import-error, |
| 21 | + import-outside-toplevel, |
| 22 | + locally-disabled, |
| 23 | + misplaced-comparison-constant, |
| 24 | + multiple-imports, |
| 25 | + no-self-use, |
| 26 | + relative-import, |
| 27 | + similarities, |
| 28 | + suppressed-message, |
| 29 | + ungrouped-imports, |
| 30 | + unsubscriptable-object, |
| 31 | + useless-object-inheritance, # Remove once all bots are on Python 3. |
| 32 | + useless-suppression, |
| 33 | + wrong-import-order, |
| 34 | + wrong-import-position, |
| 35 | + # FIXME: To be removed. Leftovers from Python 3 migration. |
| 36 | + consider-using-with, |
| 37 | + raise-missing-from, |
| 38 | + super-with-arguments, |
| 39 | + use-a-generator, |
| 40 | + consider-using-generator, |
| 41 | + consider-using-f-string, # Too much legacy usages. |
| 42 | + unspecified-encoding, # Too much legacy usage. |
| 43 | + broad-exception-raised, |
| 44 | + |
| 45 | +[BASIC] |
| 46 | + |
| 47 | +# Regular expression which should only match the name |
| 48 | +# of functions or classes which do not require a docstring. |
| 49 | +no-docstring-rgx=(__.*__|main) |
| 50 | + |
| 51 | +# Min length in lines of a function that requires a docstring. |
| 52 | +docstring-min-length=10 |
| 53 | + |
| 54 | +# Regular expression which should only match correct module names. The |
| 55 | +# leading underscore is sanctioned for private modules by Google's style |
| 56 | +# guide. |
| 57 | +# |
| 58 | +# There are exceptions to the basic rule (_?[a-z][a-z0-9_]*) to cover |
| 59 | +# requirements of Python's module system and of the presubmit framework. |
| 60 | +module-rgx=^(_?[a-z][a-z0-9_]*)|__init__|__main__|PRESUBMIT|PRESUBMIT_unittest$ |
| 61 | + |
| 62 | +# Regular expression which should only match correct module level names. |
| 63 | +const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 64 | + |
| 65 | +# Regular expression which should only match correct class attribute. |
| 66 | +class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$ |
| 67 | + |
| 68 | +# Regular expression which should only match correct class names. |
| 69 | +class-rgx=^_?[A-Z][a-zA-Z0-9]*$ |
| 70 | + |
| 71 | +# Regular expression which should only match correct function names. |
| 72 | +# 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 73 | +# styles across functions and methods. |
| 74 | +function-rgx=^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$ |
| 75 | + |
| 76 | +# Regular expression which should only match correct method names. |
| 77 | +# 'camel_case' and 'snake_case' group names are used for consistency of naming |
| 78 | +# styles across functions and methods. 'exempt' indicates a name which is |
| 79 | +# consistent with all naming styles. |
| 80 | +method-rgx=(?x) |
| 81 | + ^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase |
| 82 | + |tearDownTestCase|setupSelf|tearDownClass|setUpClass |
| 83 | + |(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next) |
| 84 | + |(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*) |
| 85 | + |(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$ |
| 86 | + |
| 87 | +# Regular expression which should only match correct instance attribute names. |
| 88 | +attr-rgx=^_{0,2}[a-z][a-z0-9_]*$ |
| 89 | + |
| 90 | +# Regular expression which should only match correct argument names. |
| 91 | +argument-rgx=^[a-z][a-z0-9_]*$ |
| 92 | + |
| 93 | +# Regular expression which should only match correct variable names. |
| 94 | +variable-rgx=^[a-z][a-z0-9_]*$ |
| 95 | + |
| 96 | +# Regular expression which should only match correct list comprehension / |
| 97 | +# generator expression variable names. |
| 98 | +inlinevar-rgx=^[a-z][a-z0-9_]*$ |
| 99 | + |
| 100 | +# Good variable names which should always be accepted, separated by a comma. |
| 101 | +good-names=main,_,maxDiff |
| 102 | + |
| 103 | +# Bad variable names which should always be refused, separated by a comma. |
| 104 | +bad-names= |
| 105 | + |
| 106 | +# FIXME: Renable this. |
| 107 | +# List of builtins function names that should not be used, separated by a comma. |
| 108 | +#bad-builtin=input |
| 109 | + |
| 110 | +[FORMAT] |
| 111 | + |
| 112 | +# Maximum number of characters on a single line. |
| 113 | +max-line-length=80 |
| 114 | + |
| 115 | +# Maximum number of lines in a module |
| 116 | +max-module-lines=99999 |
| 117 | + |
| 118 | +# String used as indentation unit. We differ from PEP8's normal 4 spaces. |
| 119 | +indent-string=' ' |
| 120 | + |
| 121 | +[TYPECHECK] |
| 122 | + |
0 commit comments