[MASTER]
ignore=build,dist,.eggs,.venv,venv,.mypy_cache,.ruff_cache,.pytest_cache
ignore-patterns=^_version\.py$,^version\.py$,^conftest\.py$
extension-pkg-whitelist=numpy,scipy,pandas,numba
jobs=0
persistent=yes
load-plugins=

[MESSAGES CONTROL]
# Start strict and tune over time; add/remove codes as you ratchet quality.
disable=
    C0103,  # missing-module-docstring
    C0114,  # missing-module-docstring
    C0115,  # missing-class-docstring
    C0116,  # missing-function-docstring
    C0200,  #
    C0411,  # wrong-import-order (instead of old E0411)
    C0413,  # wrong-import-position (instead of old E0413)
    R0902,  # too-many-instance-attributes (common in product models)
    R0913,  # too-many-arguments (pricers/calibrators often need them)
    R0914,  # too-many-locals (numerical routines)
    R0903,  # too-few-public-methods (data containers)
    R0801,  # duplicate-code (can be noisy across product variants)
    W0511,  # fixme (we allow TODO notes, use pre-commit to gate later)
    W1203,  # logging-fstring-interpolation (we prefer f-strings)
    W0231,  # logging-fstring-interpolation (we prefer f-strings)
    E1136,  # unsubscriptable-object (often false-positive with numpy)
    E0401,  # unable to import

enable=
    unused-import,
    redefined-outer-name,
    reimported,
    consider-using-with,
    consider-using-f-string

[REPORTS]
score=yes
evaluation=10.0 - ((5.0 * error) + (2.0 * warning) + (0.5 * refactor) + (0.0 * convention)) / statement
output-format=colorized

[FORMAT]
max-line-length=110
max-module-lines=4000
indent-string='    '

[BASIC]
good-names =
    i, j, k, n, m, t, x, y, z, r, q, p,
    df, pv, fv, fx, npv, irr,
    dt, dr, dv, dx,
    mu, sigma, lam, va, vc, dv01
    X, Y, Z,
    s, S, K,
    u, v, w,
    __version__

bad-names=foo,bar,baz

# Regexes for naming style checks (keep defaults except constants)
argument-rgx=[a-z_][a-z0-9_]{0,30}$
attr-rgx=[a-z_][a-z0-9_]{0,30}$
class-rgx=[A-Z_][a-zA-Z0-9]+$
const-rgx=^(_?[A-Z][A-Z0-9_]*|__version__)$
function-rgx=[a-z_][a-z0-9_]{2,30}$
method-rgx=[a-z_][a-z0-9_]{2,30}$
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
variable-rgx=[a-z_][a-z0-9_]{0,30}$

[TYPECHECK]
generated-members=numpy.*,np.*,pandas.*,pd.*
ignored-modules=numpy,scipy,pandas,numba
# Useful when stubs are imperfect

[DESIGN]
max-args=12
max-attributes=20
max-branches=20
max-locals=25
min-public-methods=0

[SIMILARITIES]
min-similarity-lines=8
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes

[EXCEPTIONS]
overgeneral-exceptions=builtins.Exception,builtins.OverflowError
