chore(lint): adopt canonical golangci-lint config
Replace .golangci.yml with the shared canonical config. The old config's top-level linters-settings block was silently ignored under the v2 schema, so the lll/funlen/cyclop/dupl thresholds now actually apply. The four repo-specific disables (mnd, exhaustive, paralleltest, testpackage) move out of the config into targeted in-code nolint directives carrying their original approval dates, keeping the config byte-identical to the canonical one. Fixes surfaced by the stricter settings: t.Parallel() added to all 32 tests, 24 overlong lines wrapped or their comments tightened, tcell control-code returns rewritten as character literals, dupl markers on the identically-shaped item data tables, and two wsl_v5 defer cuddles. No behavior changes. The repo has no golangci-lint version pin (no Dockerfile or CI; make lint runs the host binary, currently v2.12.2), so there was nothing to bump.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//nolint:mnd // C-faithful literals; names hurt C-greppability (approved 2026-07-07)
|
||||
package game
|
||||
|
||||
// tables.go — the static data tables the C game kept as file-scope globals
|
||||
@@ -166,7 +167,10 @@ const ripWall = " | |"
|
||||
//nolint:funlen,maintidx // a single composite literal holding every C data table
|
||||
func newGameData() *gameData {
|
||||
return &gameData{
|
||||
initStats: Stats{Str: 16, Exp: 0, Lvl: 1, ArmorClass: 10, HP: 12, Dmg: dice("1x4"), MaxHP: 12},
|
||||
initStats: Stats{
|
||||
Str: 16, Exp: 0, Lvl: 1, ArmorClass: 10, HP: 12,
|
||||
Dmg: dice("1x4"), MaxHP: 12,
|
||||
},
|
||||
|
||||
aClass: [NumArmorTypes]int{
|
||||
8, // LEATHER
|
||||
@@ -205,7 +209,8 @@ func newGameData() *gameData {
|
||||
{"dragon", 100, Mean, Stats{10, 5000, 10, -1, 1, dice("1x8/1x8/3x10"), 0}},
|
||||
{"emu", 0, Mean, Stats{10, 2, 1, 7, 1, dice("1x2"), 0}},
|
||||
{"venus flytrap", 0, Mean, Stats{10, 80, 8, 3, 1, dice("%%%x0"), 0}},
|
||||
{"griffin", 20, Mean | Flying | Regenerates, Stats{10, 2000, 13, 2, 1, dice("4x3/3x5"), 0}},
|
||||
{"griffin", 20, Mean | Flying | Regenerates,
|
||||
Stats{10, 2000, 13, 2, 1, dice("4x3/3x5"), 0}},
|
||||
{"hobgoblin", 0, Mean, Stats{10, 3, 1, 5, 1, dice("1x8"), 0}},
|
||||
{"ice monster", 0, 0, Stats{10, 5, 1, 9, 1, dice("0x0"), 0}},
|
||||
{"jabberwock", 70, 0, Stats{10, 3000, 15, 6, 1, dice("2x12/2x4"), 0}},
|
||||
@@ -248,6 +253,7 @@ func newGameData() *gameData {
|
||||
{Name: "plate mail", Prob: 5, Worth: 150},
|
||||
},
|
||||
|
||||
//nolint:dupl // distinct C data tables that merely share their shape
|
||||
basePotInfo: [NumPotionTypes]ObjInfo{
|
||||
{Name: "confusion", Prob: 7, Worth: 5},
|
||||
{Name: "hallucination", Prob: 8, Worth: 5},
|
||||
@@ -265,6 +271,7 @@ func newGameData() *gameData {
|
||||
{Name: "levitation", Prob: 6, Worth: 75},
|
||||
},
|
||||
|
||||
//nolint:dupl // distinct C data tables that merely share their shape
|
||||
baseRingInfo: [NumRingTypes]ObjInfo{
|
||||
{Name: "protection", Prob: 9, Worth: 400},
|
||||
{Name: "add strength", Prob: 9, Worth: 400},
|
||||
@@ -316,6 +323,7 @@ func newGameData() *gameData {
|
||||
{}, // DO NOT REMOVE: fake entry for dragon's breath
|
||||
},
|
||||
|
||||
//nolint:dupl // distinct C data tables that merely share their shape
|
||||
baseWsInfo: [NumWandTypes]ObjInfo{
|
||||
{Name: "light", Prob: 12, Worth: 250},
|
||||
{Name: "invisibility", Prob: 6, Worth: 5},
|
||||
|
||||
Reference in New Issue
Block a user