Files
OpenBB/ruff.toml
dlee-bq cad1fdcab5 Target Python 3.11 in ruff and ty for cli, core, mcp_server, platform_api, cookiecutter
With ruff target-version py310 and ty python-version 3.10, both tools
reject an unconditional `import tomllib`: ty reports it as unresolved
(exit 1) and ruff's isort classifies it as third-party. Raise the targets
in the projects that now import tomllib directly, and in the root
ruff.toml that governs dev_install.py.

- ruff target-version = "py311" and ty python-version = "3.11" in cli,
  core, mcp_server, platform_api, and cookiecutter; root ruff.toml
  target-version = "py311"
- UP042: OutputMode, ChartLifecycle, MCPType, and HTTPMethod become
  StrEnum; every consumer uses .value or == comparisons, so only str()
  and format() output change
- UP017: datetime.timezone.utc -> datetime.UTC (ruff autofix) in the cli
  dispatchers, the cli test generator, and a core test
2026-10-24 01:12:31 -07:00

88 lines
2.2 KiB
TOML
Vendored

exclude = [
"^openbb_platform/core/openbb/package/.*",
"^cookiecutter/*",
]
line-length = 88
target-version = "py311"
fix = true
[format]
# Reformat code blocks inside docstrings using the same rules.
docstring-code-format = true
docstring-code-line-length = "dynamic"
[lint]
select = [
"D",
"E",
"W",
"F",
"S",
"UP",
"I",
"PLC",
"PLE",
"PLR",
"PLW",
"SIM",
"T20",
]
ignore = [
"PLR2004", # magic-value-comparison
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLC0415", # import-outside-top-level
"E402", # module-import-not-at-top-of-file
"E501", # line-too-long (formatter handles this on best-effort)
# Docstring style choices (migrated from .pydocstyle.ini)
"D202", # no-blank-line-after-function
"D203", # one-blank-line-before-class
"D205", # blank-line-after-summary
"D206", # docstring-tab-indentation (conflicts with formatter)
"D210", # surrounding-whitespace
"D212", # multi-line-summary-first-line
"D213", # multi-line-summary-second-line
"D214", # section-not-over-indented
"D215", # section-underline-not-over-indented
"D300", # triple-single-quotes (conflicts with formatter)
"D400", # ends-in-period
"D404", # docstring-starts-with-this
"D405", # capitalize-section-name
"D406", # new-line-after-section-name
"D407", # dashed-underline-after-section
"D408", # section-underline-after-name
"D409", # section-underline-matches-section-length
"D410", # no-blank-line-after-section
"D411", # no-blank-line-before-section
"D413", # blank-line-after-last-section
"D415", # ends-in-punctuation
"D416", # section-name-ends-in-colon
"D417", # undocumented-param
]
[lint.per-file-ignores]
"**/tests/*" = ["S101"]
"*init*.py" = ["F401"]
"website/*" = ["T201", "PLR0915"]
"*integration/*" = ["S101"]
[lint.isort]
combine-as-imports = true
force-wrap-aliases = true
[lint.pylint]
max-args = 8
max-branches = 26
max-returns = 9
max-statements = 30
[lint.pydocstyle]
convention = "numpy"
[lint.flake8-import-conventions.aliases]
"matplotlib.pyplot" = "plt"
numpy = "np"
pandas = "pd"
seaborn = "sns"
openbb = "obb"