# Copr global pylint configuration.

[MASTER]
# Pickle collected data for later comparisons.
persistent=no

# Reasoning for ignored classes
# -----------------------------
# SQLAlchemy:
#     Per https://github.com/PyCQA/pylint/issues/1973#issuecomment-418980111
# scoped_session:
#     Same SQLAlchemy.
ignored-classes=SQLAlchemy,scoped_session

# Reasoning for ignored modules
# -----------------------------
# alembic:
#     Pylint entirely fails to parse the module.
#     Example error: Module 'alembic.op' has no 'drop_index' member
# setproctitle:
#     https://github.com/dvarrazzo/py-setproctitle/issues/31
ignored-modules=alembic,setproctitle

init-hook=
    import os
    import subprocess
    gitrootdir = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip()
    sys.path.insert(0, os.path.join(gitrootdir, '.pylintpath'))
    import copr_pylintrc
    copr_pylintrc.init()


# Our own pylint transformations.
load-plugins=pylint_copr_plugin

[MESSAGES CONTROL]
# Reasoning for wide warning ignore
# ---------------------------------
# import-error
#     This is to fix our Jenkins CI where we do not have all the build
#     requirements for all our sub-components.  We can afford not listening to
#     this error because our packaging CI would discover the problems anyways.
# too-few-public-methods
#     It's often useful to inherit from some (even library) class, and override
#     some static property or even just constructor.  This though makes PyLint
#     warn us if parent method doesn't provide the minimal amount of methods,
#     reported here: https://github.com/PyCQA/pylint/issues/4352
#     It's inconvenient to silence this per-class.
# consider-using-f-string
#     "style" warnings, usage of the f-strings is not yet approved by our team
# cyclic-import
#     Seems like cyclic-import is just a style check which is not going to be
#     fixed: https://github.com/PyCQA/pylint/issues/6983
disable=import-error,too-few-public-methods,consider-using-f-string,cyclic-import

[VARIABLES]
# A regular expression matching names used for dummy variables (i.e. not used).
# - "step_impl" is used for all the behave steps
dummy-variables-rgx=_|dummy|step_impl


[BASIC]
# Regular expression which should only match correct module names
# We ignore all
# - "copr-*" scripts (lowercase)
# - alembic migrations
# - fdec9947f8a1
# Default is: [a-z_][a-z0-9_]{2,30}$
module-rgx=(copr-[a-z-]*|[0-9a-f]{12}_[a-z_]+|[a-z_][a-z0-9_]{2,30})$

# Regular expression which should only match correct module level names
const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$

# Regular expression which should only match correct class names
class-rgx=[a-zA-Z_][a-zA-Z0-9_]+$

# Regular expression which should only match correct function names
function-rgx=[a-z_][a-zA-Z0-9_]{,42}$

# Regular expression which should only match correct method names
method-rgx=[a-z_][a-zA-Z0-9_]{,42}$

# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-zA-Z0-9_]{,30}$

# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-zA-Z0-9_]{,30}$

# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-zA-Z0-9_]{,30}$

# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression which should only match correct class sttribute names
class-attribute-rgx=id|([A-Za-z_][A-Za-z0-9_]{2,42}|(__.*__))$

# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_

# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# List of builtins function names that should not be used, separated by a comma
bad-functions=apply,input


[DESIGN]

# Maximum number of arguments for function / method
max-args=10

# Maximum number of locals for function / method body
max-locals=20

# Maximum number of return / yield for function / method body
max-returns=6

# Maximum number of branch for function / method body
max-branchs=20

# Maximum number of statements in function / method body
max-statements=50

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Minimum number of public methods for a class (see R0903).
min-public-methods=1

# Maximum number of public methods for a class (see R0904).
max-public-methods=20


[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120

# Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string='    '


[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=


[SIMILARITIES]
# default is 4, which is pretty small
min-similarity-lines=8
