github.com/apache/beam/sdks/v2@v2.48.2/python/.pylintrc (about)

     1  #
     2  #    Licensed to the Apache Software Foundation (ASF) under one or more
     3  #    contributor license agreements.  See the NOTICE file distributed with
     4  #    this work for additional information regarding copyright ownership.
     5  #    The ASF licenses this file to You under the Apache License, Version 2.0
     6  #    (the "License"); you may not use this file except in compliance with
     7  #    the License.  You may obtain a copy of the License at
     8  #
     9  #       http://www.apache.org/licenses/LICENSE-2.0
    10  #
    11  #    Unless required by applicable law or agreed to in writing, software
    12  #    distributed under the License is distributed on an "AS IS" BASIS,
    13  #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  #    See the License for the specific language governing permissions and
    15  #    limitations under the License.
    16  #
    17  
    18  [MASTER]
    19  # Ignore auto-generated files.
    20  ignore=clients
    21  
    22  [BASIC]
    23  # Regular expression which should only match the name
    24  # of functions or classes which do not require a docstring.
    25  no-docstring-rgx=(__.*__|main)
    26  
    27  # Min length in lines of a function that requires a docstring.
    28  docstring-min-length=10
    29  
    30  # Regular expression which should only match correct module names. The
    31  # leading underscore is sanctioned for private modules by Google's style
    32  # guide.
    33  #
    34  # There are exceptions to the basic rule (_?[a-z][a-z0-9_]*) to cover
    35  # requirements of Python's module system and of the presubmit framework.
    36  module-rgx=^(_?[a-z][a-z0-9_]*)|__init__|PRESUBMIT|PRESUBMIT_unittest$
    37  
    38  # Regular expression which should only match correct module level names
    39  const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
    40  
    41  # Regular expression which should only match correct class attribute
    42  class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
    43  
    44  # Regular expression which should only match correct class names
    45  class-rgx=^_?[A-Z][a-zA-Z0-9]*$
    46  
    47  # Regular expression which should only match correct function names.
    48  # 'camel_case' and 'snake_case' group names are used for consistency of naming
    49  # styles across functions and methods.
    50  function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
    51  
    52  # Regular expression which should only match correct method names.
    53  # 'camel_case' and 'snake_case' group names are used for consistency of naming
    54  # styles across functions and methods. 'exempt' indicates a name which is
    55  # consistent with all naming styles.
    56  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_]*))$
    57  
    58  # Regular expression which should only match correct instance attribute names
    59  attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
    60  
    61  # Regular expression which should only match correct argument names
    62  argument-rgx=^[a-z][a-z0-9_]*$
    63  
    64  # Regular expression which should only match correct variable names
    65  variable-rgx=^[a-z][a-z0-9_]*$
    66  
    67  # Regular expression which should only match correct list comprehension /
    68  # generator expression variable names
    69  inlinevar-rgx=^[a-z][a-z0-9_]*$
    70  
    71  # List of builtins function names that should not be used, separated by a comma
    72  bad-functions=input,apply,reduce
    73  
    74  # Good variable names which should always be accepted, separated by a comma
    75  good-names=main,_
    76  
    77  # Bad variable names which should always be refused, separated by a comma
    78  bad-names=
    79  
    80  [MESSAGES CONTROL]
    81  disable =
    82    abstract-method,
    83    abstract-class-instantiated,
    84    arguments-differ,
    85    arguments-renamed,
    86    attribute-defined-outside-init,
    87    bad-builtin,
    88    bad-continuation,
    89    broad-except,
    90    comparison-with-callable,
    91    consider-using-enumerate,
    92    consider-using-f-string,
    93    consider-using-in,
    94    consider-using-sys-exit,
    95    consider-using-with,
    96    cyclic-import,
    97    design,
    98    fixme,
    99    global-statement,
   100    import-error,
   101    import-outside-toplevel,
   102    import-self,
   103    inconsistent-return-statements,
   104    invalid-overridden-method,
   105    invalid-name,
   106    keyword-arg-before-vararg,
   107    len-as-condition,
   108    locally-disabled,
   109    locally-enabled,
   110    logging-not-lazy,
   111    missing-docstring,
   112    multiple-statements,
   113    no-else-break,
   114    no-else-continue,
   115    no-else-raise,
   116    no-else-return,
   117    no-member,
   118    no-name-in-module,
   119    no-self-argument,
   120    no-self-use,
   121    no-value-for-parameter,
   122    not-callable,
   123    pointless-statement,
   124    protected-access,
   125    raise-missing-from, #TODO(https://github.com/apache/beam/issues/21169) Enable and fix warnings
   126    raising-format-tuple,
   127    redefined-builtin,
   128    redefined-outer-name,
   129    redefined-variable-type,
   130    redundant-keyword-arg,
   131    relative-import,
   132    similarities,
   133    simplifiable-if-statement,
   134    stop-iteration-return,
   135    super-init-not-called,
   136    try-except-raise,
   137    undefined-variable,
   138    unexpected-keyword-arg,
   139    unidiomatic-typecheck,
   140    unnecessary-comprehension,
   141    unnecessary-lambda,
   142    unnecessary-pass,
   143    unneeded-not,
   144    unsubscriptable-object,
   145    unspecified-encoding, #TODO(https://github.com/apache/beam/issues/21236) Enable explicit encoding
   146    unused-argument,
   147    unused-wildcard-import,
   148    useless-object-inheritance,
   149    wildcard-import,
   150    wrong-import-order,
   151  
   152  [REPORTS]
   153  # Tells whether to display a full report or only the messages
   154  reports=no
   155  
   156  [CLASSES]
   157  # List of method names used to declare (i.e. assign) instance attributes.
   158  defining-attr-methods=__init__,__new__,setUp
   159  
   160  # "class_" is also a valid for the first argument to a class method.
   161  valid-classmethod-first-arg=cls,class_
   162  
   163  [FORMAT]
   164  # Maximum number of characters on a single line.
   165  max-line-length=80
   166  
   167  # Maximum number of lines in a module
   168  max-module-lines=99999
   169  
   170  # String used as indentation unit. (2 spaces.)
   171  indent-string='  '
   172  
   173  # Number of spaces of indent required.
   174  indent-after-paren=4
   175  
   176  # Regexp for a line that is allowed to be longer than the limit.
   177  # Long import lines or URLs in comments or pydocs.
   178  ignore-long-lines=(?x)
   179    (^\s*(import|from)\s
   180     |^\s*(\#\ )?<?(https?|ftp):\/\/[^\s\/$.?#].[^\s]*>?$
   181     |^.*\#\ type\:
   182     |^.*LegacyArtifact
   183     )
   184  
   185  [VARIABLES]
   186  # Tells whether we should check for unused import in __init__ files.
   187  init-import=no
   188  
   189  # A regular expression matching names used for dummy variables (i.e. not used).
   190  dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_|args|kwargs)