Files
archie/.golangci.yml
T
sam e18fb8b204 feat(webui): bootstrap Vue 3 + shadcn-vue, replacing the Preact dashboard
Sam owns this codebase and reads Vue fluently, not Preact; a UI its maintainer
cannot read is the liability that outweighs the port. shadcn-vue is Vue-only,
so adopting it means the framework moves with it.

Scaffolded per the official Vite guide: `npm create vite --template vue-ts`,
Tailwind v4 via @tailwindcss/vite, `shadcn-vue init` (Reka UI, Lucide, neutral
base, CSS variables). Button and DropdownMenu are added, the latter being what
the pending navigation restructure needs.

Two deviations from the guide, both forced:

  - The guide sets `baseUrl` alongside `paths`. TypeScript 6 deprecates
    `baseUrl` and errors on it, and this project is heading for TS 7 native, so
    `paths` stands alone and resolves relative to the config file. Not a
    downgrade: the scaffold's typescript ~6.0.2 is untouched.
  - vite.config.ts keeps `base: "./"` and unhashed asset names. ui/embed.go
    embeds a committed dist/, served from a path the build does not know;
    hashed names would also orphan a file in git on every rebuild.

The Preact app and its 43 test files are deleted rather than ported, on Sam's
instruction: tests return when there is behaviour worth pinning rather than a
port to re-assert. `task test:ui` is now a vue-tsc typecheck, which is what
would actually catch a broken component; an empty `npm test` would pass
vacuously.

ui/src/router/index.ts carries the route table and is the new source of truth
for TestDashboardPagesRegistryCoversEveryRoute, which parsed main.jsx before.
Keeping that contract alive matters: it is what caught the stale /chat entry
earlier today. Every route resolves to a named placeholder view, so an unported
page is visibly unported rather than blank.

golangci-lint now excludes ui/node_modules. The dashboard toolchain pulls in
`flatted`, which ships a Go implementation beside its JavaScript, and the gate
was failing on complexity in a vendored third-party file.

The shadcn MCP server is registered in the root .mcp.json. `shadcn-vue mcp init`
writes it to the directory it runs in, which for a nested ui/ is a path Claude
Code never reads.
2026-09-20 17:14:47 +10:00

164 lines
4.1 KiB
YAML

# golangci-lint configuration for archie-core.
#
# Schema: https://golangci-lint.run/jsonschema/golangci.jsonschema.json
# Every option is documented upstream in .golangci.reference.yml.
# Validate changes with `golangci-lint config verify` before committing.
#
# Philosophy: this repo's gate is `task check`, and archied runs that same
# gate against its own PRs. A linter here is therefore an environmental
# constraint an agent cannot argue its way around -- the doctrine CLAUDE.md
# applies to safety, applied to structure. Curated over exhaustive: a noisy
# gate gets disabled, and a disabled gate enforces nothing.
version: "2"
run:
timeout: 5m
tests: true
go: "1.26"
linters:
default: standard
enable:
# Structure and complexity
- cyclop
- dupl
- funlen
- gocognit
- gocyclo
- maintidx
- nestif
# Architecture
- importas
- interfacebloat
# Correctness
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- durationcheck
- errorlint
- fatcontext
- forcetypeassert
- makezero
- nilerr
- nilnesserr
- noctx
- reassign
- recvcheck
- rowserrcheck
- sqlclosecheck
# Idiom and hygiene
- gocritic
- godox
- misspell
- predeclared
- sloglint
- unconvert
- usestdlibvars
- usetesting
settings:
cyclop:
max-complexity: 15
dupl:
threshold: 150
funlen:
lines: 80
statements: 50
gocognit:
min-complexity: 30
gocyclo:
min-complexity: 20
maintidx:
under: 20
nestif:
min-complexity: 5
godox:
# Tracked work lives in GitHub Issues.
keywords:
- FIXME
- TODO
- HACK
- BUG
interfacebloat:
max: 8
sloglint:
no-mixed-args: true
key-naming-case: snake
exclusions:
generated: lax
warn-unused: true
# npm dependencies are not this module's code. `flatted`, pulled in
# transitively by the dashboard toolchain, ships a Go implementation
# alongside its JavaScript, and linting a vendored third-party file fails
# the gate on complexity nobody here can fix.
paths:
- ui/node_modules
presets:
- comments
- std-error-handling
- common-false-positives
- legacy
rules:
# Table-driven tests are supposed to resemble each other, and
# splitting one to satisfy a complexity budget makes it harder to
# read. Correctness linters still apply to tests.
- path: _test\.go
linters:
- cyclop
- dupl
- funlen
- gocognit
- gocyclo
- maintidx
formatters:
# goimports is deliberately absent. golangci-lint's goimports formatter
# builds a fresh x/tools ProcessEnv per file, so internal/imports re-reads
# and re-parses $GOMODCACHE's module index once per file -- 63 MiB here,
# ~155ms each, ~135s across this tree, and again on a cold `golangci-lint
# run`. gofumpt and gci cover formatting and grouping; a missing or unused
# import is a compile error, and formatter drift is reported by run itself.
enable:
- gofumpt
- gci
settings:
gofumpt:
extra:
group-params: true
gci:
# Matches the grouping already used across this repo.
sections:
- standard
- default
- prefix(github.com/samcharles93/archie-core)
custom-order: true
exclusions:
generated: strict
# These Yaegi programs sit behind //go:build ignore, so a formatter cannot
# type-check them: rewriting their imports deletes the genuinely used
# internal/secret import and the interpreter can no longer load them.
# Excluded from every formatter so adding one cannot reintroduce that.
paths:
- ^examples/secret-engines/(age|sops|vault)\.go$
issues:
# 0 = report everything. The defaults (50 per linter, 3 per message)
# silently truncate, which turns the issue count into a number you
# cannot track downward.
max-issues-per-linter: 0
max-same-issues: 0
output:
show-stats: true
sort-order:
- linter
- file