mirror of
https://github.com/reconurge/flowsint.git
synced 2026-11-10 01:45:55 -06:00
One tool instead of three, one config instead of four duplicated blocks. black/isort/flake8 dropped from every package's dev deps, ruff added once; .flake8 deleted, [tool.black]/[tool.isort] blocks deleted from all 4 sub-package pyproject.toml files. Config lives once, at the workspace root: ruff walks up from any file it's checking until it finds a pyproject.toml with a [tool.ruff] table (verified empirically — a package's own pyproject.toml lacking that table doesn't stop the search), so the root-level [tool.ruff] applies to all four packages without duplication. That's the one real win over the old per-package black/isort blocks, which had to be copy-pasted four times and kept in sync by hand. Same rule surface as before, not more: select = E/F/W/I (pycodestyle + pyflakes + isort-equivalent), matching exactly what flake8 checked. ruff has other rule groups (UP/pyupgrade, B/bugbear) that would surface real things — deliberately left off. Turning those on finds new debt and is a separate decision with its own diff to review, not a side effect of swapping the tool underneath an unchanged rule set. Same E501 exclusion carried over too, same reasoning: the formatter is the sole authority on line length. known-first-party carries over unchanged (same isort concern this repo already fixed once — see "app" vs "flowsint_api" in the ratchet history) and the wildcard-import per-file-ignore for flowsint_core/__init__.py still applies, verified directly. Six files reformatted by `ruff format` where it disagreed with black on edge cases (import grouping, ternary line-breaking, blank lines after a class statement) — all cosmetic, no behavior change, reviewed diff by diff. One real ruff-check finding (an import block ruff's isort-equivalent wanted sorted differently) — took ruff check --fix. Verified: `make lint` clean, `make test` green (all 4 packages), lint-staged tested with a real staged-file run (not just config inspection) to confirm `uv run ruff format` / `uv run ruff check --fix` actually execute, mypy ratchet target unaffected (still fires on its own pre-existing backlog, unrelated to this change).
80 lines
3.1 KiB
TOML
80 lines
3.1 KiB
TOML
[project]
|
|
name = "flowsint"
|
|
version = "1.2.11"
|
|
description = "Flowsint multi-module project"
|
|
authors = [{ name = "dextmorgn", email = "contact@flowsint.io" }]
|
|
requires-python = ">=3.12,<4.0"
|
|
dependencies = [
|
|
"flowsint-core",
|
|
"flowsint-types",
|
|
"flowsint-enrichers",
|
|
"flowsint-api",
|
|
"pydantic[email]>=2.11.7,<3.0.0",
|
|
"python-multipart>=0.0.27,<0.1.0",
|
|
"docker>=7.1.0,<8.0.0",
|
|
]
|
|
|
|
[tool.uv.workspace]
|
|
members = [
|
|
"flowsint-api",
|
|
"flowsint-core",
|
|
"flowsint-enrichers",
|
|
"flowsint-types",
|
|
]
|
|
|
|
[tool.uv.sources]
|
|
flowsint-core = { workspace = true }
|
|
flowsint-types = { workspace = true }
|
|
flowsint-enrichers = { workspace = true }
|
|
flowsint-api = { workspace = true }
|
|
|
|
# Single config for the whole workspace: ruff walks up from any file being
|
|
# linted until it finds a pyproject.toml with a [tool.ruff] table, so this
|
|
# root section applies to all four packages — no need to duplicate it the
|
|
# way black/isort/flake8 were duplicated per-package before this migration.
|
|
[tool.ruff]
|
|
line-length = 88
|
|
target-version = "py312"
|
|
extend-exclude = [
|
|
"migrations",
|
|
"neo4j-migrations",
|
|
]
|
|
|
|
[tool.ruff.lint]
|
|
# E = pycodestyle errors, F = pyflakes, W = pycodestyle warnings, I = isort
|
|
# (replaces the standalone isort tool). Matches the old flake8 setup's rule
|
|
# surface exactly — this migration swaps the tool, not the rule set. ruff
|
|
# has other rule groups (UP/pyupgrade, B/bugbear, etc.) that would find
|
|
# real things, but turning those on is a separate decision with its own
|
|
# diff to review, not a side effect of a tool swap.
|
|
select = ["E", "F", "W", "I"]
|
|
# E203/W503 aren't in the default select set to begin with (ruff doesn't
|
|
# enable them), but the old flake8 config's real intent — "don't fight the
|
|
# formatter's own choices" — carries over automatically: ruff's formatter
|
|
# and linter are designed to agree, unlike black+flake8 which needed the
|
|
# explicit truce.
|
|
# E501 (line-too-long): the formatter is the sole authority on code line
|
|
# length. What's left after `ruff format` runs is long comments/docstrings/
|
|
# string literals (URLs, mostly) — style noise, not a correctness signal.
|
|
# Same exclusion the old flake8 config carried, same reasoning.
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.lint.isort]
|
|
# Same list the old isort config carried per-package (see git history) —
|
|
# "app" is flowsint-api's own importable module name (FastAPI convention),
|
|
# distinct from its pip/build name "flowsint-api".
|
|
known-first-party = ["flowsint_core", "flowsint_types", "flowsint_enrichers", "flowsint_api", "app"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Known debt, not a green-light: package re-exports its entire public API via
|
|
# wildcard imports from 11 submodules, no explicit __all__. Works today, but
|
|
# nothing stops two submodules from silently shadowing each other's names.
|
|
# Tracked for a real fix (explicit imports + __all__); not blind-fixed here
|
|
# because it risks breaking every downstream `from flowsint_core import X`.
|
|
"flowsint-core/src/flowsint_core/__init__.py" = ["F401", "F403"]
|
|
|
|
[tool.ruff.format]
|
|
# Matches black's defaults, which this replaces.
|
|
quote-style = "double"
|
|
indent-style = "space"
|