chore(tooling): T-1272 + T-1274 — close E3: no hyphens left, and the lint ignores come off

T-1272 (a verification, as rescoped). No directory Python imports carries a
hyphen any more. The hyphenated script trees were emptied by the per-domain
moves, not renamed. What still has a hyphen is never imported: the three Rust
crates, and the provenance under tooling/archive/, which has no __init__.py.
CLAUDE.md and DEVOPS still pointed at tooling/db/, and pyproject still
predicted the rename; all three fixed.

T-1274. E402, E702 and F841 were ignored for the whole tree from T-1066 on
(43 / 41 / 21 violations). All three are back on:

- E402: the planet modules' imports only sat below their path constants
  because they used to follow a sys.path insert, gone since T-1288. Hoisted.
  The Blender payloads keep a per-file exception, because they extend
  sys.path under Blender's own Python.
- E702: the paired component assignments in three planet maths files are
  deliberate, so they get a per-file exception scoped to those files.
- F841: 10 dead locals removed from live code, each checked for side effects
  first; logo_uv keeps its call, which creates the UV layer.
- tooling/archive/ is excluded: it is provenance, and "fixing" a one-shot
  falsifies the record of what actually ran.

Evidence the lint is real: violations fed through stdin fire in a domain
module, and E402 stays quiet only on a payload path. Evidence nothing moved:
globe renders are pixel-identical before and after for an oceanic, a frozen
and a gas-giant body, and the ledger edit was regenerated (stamp fresh,
generated_brands.toml unchanged).

One finding, noted in the code rather than fixed: planet_renderer computed an
oblate-spheroid ray scale and never used it, so `oblateness` shapes no globe.
Wiring it in would change every globe render; that is a decision to make
deliberately, not a lint fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 20:05:07 +02:00
co-authored by Claude Opus 5.5
parent 59b3fc4caa
commit 6fb0ba0e3d
17 changed files with 110 additions and 69 deletions
+26 -11
View File
@@ -48,11 +48,13 @@ reach = "tooling.main:main"
# docs/, wiki/, db/ and tests/ alongside tooling/, and auto-discovery either
# errors on the ambiguity or quietly ships something unintended (T-1258).
#
# Nothing needs excluding yet: the hyphenated directories (planet-gen,
# economy-db, garment-fit, pql-migrate) are invisible to package discovery
# because a hyphen is not a valid Python identifier, and tooling/econ-sim is a
# Rust crate with no __init__.py. That changes in T-1250, which renames them —
# at which point they become real packages and this include starts matching them.
# Nothing needs excluding: discovery only finds directories with an
# __init__.py. The hyphenated script trees were emptied by T-1250's per-domain
# moves rather than renamed (verified in T-1272); what still carries a hyphen
# is never imported — the three Rust crates (econ-sim, line-previewer,
# test-client) and the provenance under tooling/archive/, which has no
# __init__.py on purpose. tooling/scripts/blender/ likewise has none: its
# payloads run under Blender's Python and must not become package modules.
include = ["tooling*"]
[project.optional-dependencies]
@@ -64,6 +66,10 @@ dev = [
[tool.ruff]
line-length = 100
target-version = "py311"
# Provenance, never run (tooling/archive/README.md). Linting it produces fixes
# to code nobody should execute, and a "fixed" one-shot is no longer a faithful
# record of what actually ran.
extend-exclude = ["tooling/archive"]
[tool.ruff.lint]
# Widened from {E9, F401, F811, F821} to the full ruff-default tiers + W (T-1066).
@@ -73,9 +79,18 @@ target-version = "py311"
# F: all pyflakes (unused imports/names, undefined names, f-string misuse, ...)
# W: whitespace + invalid escape sequences (zero violations at adoption)
select = ["E4", "E7", "E9", "F", "W"]
# Rules excluded at adoption because the existing violation count was not
# trivially fixable (T-1066) — re-enable per-rule as the debt is paid down:
# E402 (43×): module-import-not-at-top — script-style sys.path.insert before import
# E702 (41×): semicolon-paired assignments, deliberate style in planet-gen noise math
# F841 (21×): unused locals, mostly in numeric/diagnostic code — needs manual review
ignore = ["E402", "E702", "F841"]
# E402, E702 and F841 were ignored tree-wide at adoption (T-1066: 43/41/21
# violations). T-1274 re-enabled all three once the package existed. What
# remains is narrow and says why, per file, below — a documented exception is
# worth more than a broad silent one.
[tool.ruff.lint.per-file-ignores]
# Blender payloads run under Blender's bundled Python, which cannot see the
# repo venv; the ones that import helpers extend sys.path first (T-1273).
"tooling/scripts/blender/*.py" = ["E402"]
# Semicolon-paired component assignments (`rdx /= mag; rdy /= mag; ...`) are a
# deliberate style in the terrain noise and shading maths: the three axes of
# one vector read as one statement. Scoped to the files that use it.
"tooling/domains/atlas/planet/planet_simulation.py" = ["E702"]
"tooling/domains/atlas/planet/planet_renderer.py" = ["E702"]
"tooling/domains/atlas/planet/render_heightmap.py" = ["E702"]