Add AGENTS.md and bump to Go 1.25

This commit is contained in:
2025-12-18 08:17:58 +01:00
parent b6148b9fd8
commit 47ea4eb509
3 changed files with 32 additions and 4 deletions

21
AGENTS.md Normal file
View File

@ -0,0 +1,21 @@
# AGENTS
- Go 1.25; modules in `go.mod`; binary name `statusline`.
- Build: `task build` (stripped) or `go build -o bin/statusline .`.
- Run fixture: `task run` or `cat test/fixture.json | ./bin/statusline`.
- Tests: `task test` (`go test -v ./...`); single test: `go test -v -run 'TestName' ./...`.
- Coverage: `task test:cover`; benchmarks: `task bench` or `task bench:go`.
- Lint: `task lint` (`golangci-lint run`); auto-fix: `task lint:fix`.
- Formatting: `gofumpt` + `goimports` via golangci-lint; keep `go fmt`/gofumpt style.
- Imports: organize with `goimports`; stdlib first, then third-party, then local.
- Types: prefer explicit types; avoid unused code (lint-enforced).
- Naming: follow Go conventions (ExportedCamelCase for exported, lowerCamelCase for unexported); no stutter.
- Errors: check and return errors; wrap or format with context; no silent ignores.
- Security: `gosec` enabled; avoid leaking secrets; handle paths carefully.
- Tests should avoid external deps; skip when environment-dependent.
- Modernization helpers: `task modernize` / `task modernize:test` (gopls).
- Clean artifacts: `task clean`; binary lives in `bin/`.
- Git info and gitea checks rely on `go-git` and `gopsutil`; keep deps updated via `go mod tidy`.
- Keep ANSI handling via `stripANSI` regex in `main.go`; adjust carefully if changing.
- No Cursor/Copilot rules present as of this file.
- No emojis in code or docs unless explicitly requested.