5 Commits

Author SHA1 Message Date
Shane McGovern ba3c8ad754 Merge remote-tracking branch 'origin/dev' into nexhas28-wild-encounter-grace-period
dev added the public Encounters.tableFor export (MapCatalog resolution,
prefix stripping, route normalization) at the same point in
src/core/game3/encounters.lua where this branch inserts the cooldown
block. The two changes are purely additive, so both are kept: dev's
export sits next to table_for where it belongs, followed by the
cooldown/rate-test block.

scripts/lint.sh auto-merged cleanly, keeping both dev's PATH export for
node_modules/.bin and ~/.luarocks/bin and this branch's luacheck --version
probe.

Re-verified after the merge that dev's RNG-parity commit does not shift
the encounter goldens: 88/88 cooldown checks still pass, including the
Route 1 4000-step counts (401 with the grace period vs 858 without).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-19 10:29:50 +01:00
Shane McGovern 4f07872b86 Diagnose luacheck builds that cannot run under Lua 5.5
luacheck 1.2.0 is the newest release and predates Lua 5.5, which made
generic-for control variables read-only. Built against Lua 5.5 it dies
loading luacheck.standards -- before linting a single file -- so the T0
gate can never pass, and the failure surfaced only as a raw loader
traceback that looks like a repo defect.

Probe `luacheck --version` before the real run:

  - if it cannot run, print the captured error plus the Lua 5.4 install
    command and exit 2, matching the existing not-found path
  - if it runs but reports Lua 5.5, warn that 1.2.0 predates it and that
    results are suspect, then lint anyway

CI is unaffected: it installs luacheck against Ubuntu's Lua, not 5.5.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-19 09:58:37 +01:00
1jamie 18a30b83f0 fix(game3): add partial_trap_name helper and include search path in lint.sh 2026-09-19 01:37:32 -05:00
bryanthaboi c0f4315cd8 Fix Gen 1/2 battle, menu, PC and audio parity gaps; wire luacheck into CI
CLOSES #1484, CLOSES #1486, CLOSES #1513, CLOSES #1517, CLOSES #1556, CLOSES #1564, CLOSES #1567
2026-08-21 19:22:34 -04:00
Claude 74eeb411ba Add luacheck config + lint script
Introduce a tuned .luacheckrc and scripts/lint.sh so the engine has a
standing static-analysis baseline -- the tool that would have caught both
bugs in the previous commit before they shipped.

The config is high-signal by design: it keeps the categories that catch
real defects (undefined globals/locals, unused values, unreachable code)
and mutes the cosmetic ones the codebase deliberately lives with (a self/dt
an interface requires but a method ignores, documented empty fall-through
branches, long lines). It marks `love` mutable (games assign callbacks onto
it) and teaches it LuaJIT's table.unpack.

.luacheckrc is tracked via a .gitignore exception, matching how .github and
.gitignore opt out of the blanket dotfile ignore.

`luacheck src` now reports 7 benign warnings and 0 errors, down from 185.
Also drop one dead `require` (ItemEffects loaded src.pokemon.Pokemon and
never used it).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6bFAiQyZ5jDmewsbB4LG9
2026-07-31 14:35:40 +00:00