fix(@projects/@magic-civilization): 🐛 resolve remaining gdlint violations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
3fd29fee3c
commit
260e6cfcbe
2 changed files with 29 additions and 24 deletions
|
|
@ -89,21 +89,27 @@ removal reduces that category.
|
|||
|
||||
## 2026-05-09 inline progress
|
||||
|
||||
Reduced violation count from 56 → 41 (15 fixed) without specialist dispatch:
|
||||
Reduced violation count from 56 → 10 (46 fixed). All non-refactor lint debt
|
||||
is now zero. The remaining 10 are all `max-file-lines` on 10 files exceeding
|
||||
the 500-line cap; each requires a per-file split (explicitly p2-10k non-goal,
|
||||
blocked on p0-26 for `auto_play.gd` and analogous extraction objectives for
|
||||
the rest — `city.gd`, `game_state.gd`, `combat_resolver.gd`, etc.).
|
||||
|
||||
- `auto_play.gd` 14 → 1 violation (only `max-file-lines` remains — needs file split, blocked on p0-26 Rust port).
|
||||
- Mixed-tabs-and-spaces fix at lines 867-868 (tab+space→tab indent).
|
||||
- Duplicated-load fix: `combat_resolver.gd` was loaded twice via `load()` in
|
||||
attack-adjacent-enemy + attack-adjacent-city paths; promoted to a single
|
||||
`const CombatResolverScript: GDScript = preload(...)` at the top.
|
||||
- 9 max-line-length fixes across `auto_play.gd` (mechanical: split print
|
||||
args across lines, hoist inline ternaries to multi-line if blocks, extract
|
||||
long array literals into local vars).
|
||||
**Categories cleared:**
|
||||
- 32 max-line-length (mechanical — split print args, multi-line if-blocks,
|
||||
extract long array/expression literals across 9 files).
|
||||
- 6 class-definitions-order (audio_manager.gd `SIMPLE_ROUTES` const moved
|
||||
above functions; culture_web.gd / tech_web.gd `_nodes` property accessor
|
||||
before functions; game_state.gd public-vars before private-vars).
|
||||
- 2 mixed-tabs-and-spaces (auto_play.gd 867-868).
|
||||
- 1 duplicated-load (auto_play.gd combat_resolver.gd promoted to top-level
|
||||
`const CombatResolverScript: GDScript = preload(...)`).
|
||||
- 1 no-elif-return (unit_renderer.gd:380 — replaced `elif` with `if` after
|
||||
early `return`).
|
||||
- 1 function-variable-name (procedural_renderer.gd:325 `by_` → `bottom_y`).
|
||||
- 1 load-constant-name (game_state.gd `_SerializationHelpers` →
|
||||
`SerializationHelpers`).
|
||||
|
||||
Remaining 41 violations break down: 22 max-line-length (mechanical),
|
||||
10 max-file-lines (10 files exceed 500 lines — each needs a refactor),
|
||||
6 class-definitions-order (audio_manager.gd / tech_web.gd / culture_web.gd),
|
||||
1 no-elif-return (unit_renderer.gd:380), 1 load-constant-name,
|
||||
1 function-variable-name. The mechanical max-line-length fixes can land in
|
||||
another inline pass; the 10 max-file-lines blockers need per-file
|
||||
extraction objectives or a project-wide max-file-lines lint relaxation.
|
||||
**Status:** stays `partial`. Acceptance bullet 1 (`gdlint exit 0`) and
|
||||
bullet 4 (CI Stage 3 hard-green) remain blocked by the 10 max-file-lines
|
||||
violations until the file-split objectives land.
|
||||
|
|
|
|||
|
|
@ -28,6 +28,13 @@ const _CONFIG: Dictionary = {
|
|||
|
||||
var _web: KnowledgeWebScript = KnowledgeWebScript.new(_CONFIG)
|
||||
|
||||
# ── Internal `_nodes` accessor — TurnManager uses it as a "is loaded" probe ─
|
||||
|
||||
var _nodes: Dictionary:
|
||||
get:
|
||||
# Non-empty once `build()` has run.
|
||||
return {0: 1} if _web.get_node_count() > 0 else {}
|
||||
|
||||
|
||||
# ── TurnManager-compatible API (build / heritage) ───────────────────────
|
||||
|
||||
|
|
@ -59,14 +66,6 @@ func apply_heritage_tech(player: RefCounted) -> void:
|
|||
p.add_tech(origin)
|
||||
|
||||
|
||||
# ── Internal `_nodes` accessor — TurnManager uses it as a "is loaded" probe ─
|
||||
|
||||
var _nodes: Dictionary:
|
||||
get:
|
||||
# Non-empty once `build()` has run.
|
||||
return {0: 1} if _web.get_node_count() > 0 else {}
|
||||
|
||||
|
||||
# ── Graph queries (proxied to KnowledgeWeb) ─────────────────────────────
|
||||
|
||||
func get_pillars() -> Array[String]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue