Reconciles next with three merges it predated: the 60s/90s test budget, thin cmd/ entrypoints, and the .golangci.yml prohibition scoped to vendored copies. Conflicts: - prompts/REPO_POLICIES.md frontmatter: took main's later last_modified. - prompts/NEW_REPO_CHECKLIST.md: main's test-budget line, next's containerised-lint line. The two edits touch adjacent list items only. - prompts/REPO_POLICIES.md .golangci.yml bullet: both sides rewrote it. Took main's vendored-copy scoping and the change-by-re-vendoring sentence, and kept next's digest pin in Dockerfile.lint, which supersedes the host go install that main's text still describes. The test-budget text is main's verbatim on both sides of every conflict.
This commit is contained in:
@@ -148,10 +148,15 @@ last_modified: 2026-08-10
|
|||||||
|
|
||||||
1. Keep the `main()` function as small as possible.
|
1. Keep the `main()` function as small as possible.
|
||||||
|
|
||||||
1. Keep the `main` package as small as possible. Move as much code as is
|
1. Keep the `main` package as small as possible. Each `cmd/<name>/` directory
|
||||||
feasible to a library package, even if it's an internal one. `main` is just
|
contains a single `main.go` whose body is one call into library code (for
|
||||||
an entrypoint to your code, not a place for implementations. Exception:
|
example `os.Exit(cli.Main())` calling `internal/cli`). All CLI logic — flag
|
||||||
single-file scripts.
|
parsing, subcommand dispatch, argument handling, output formatting — lives
|
||||||
|
in `internal/` or `pkg/`, not in `cmd/`. `main` is just an entrypoint to
|
||||||
|
your code, not a place for implementations. Exception: single-file scripts.
|
||||||
|
|
||||||
|
1. No project logic outside `internal/` or `pkg/`. Anything in `cmd/` is a thin
|
||||||
|
entrypoint only.
|
||||||
|
|
||||||
1. HTTP HandleFuncs should be returned from methods or functions that need to
|
1. HTTP HandleFuncs should be returned from methods or functions that need to
|
||||||
handle HTTP requests. Don't use methods or your top level functions as
|
handle HTTP requests. Don't use methods or your top level functions as
|
||||||
|
|||||||
@@ -128,7 +128,9 @@ with your task.
|
|||||||
exports, no `--allow-serial-runners`, and `.lint-cache/` removed from
|
exports, no `--allow-serial-runners`, and `.lint-cache/` removed from
|
||||||
`.gitignore` and `.dockerignore`.
|
`.gitignore` and `.dockerignore`.
|
||||||
- [ ] `make check` does not modify any files in the repo
|
- [ ] `make check` does not modify any files in the repo
|
||||||
- [ ] `make test` has a 30-second timeout
|
- [ ] `make test` has a 90-second timeout and completes within the 60-second
|
||||||
|
hard cap (over 20 seconds is green but must be filed as an improvement
|
||||||
|
bug)
|
||||||
- [ ] `make test` runs real tests, not a no-op (at minimum, import/compile
|
- [ ] `make test` runs real tests, not a no-op (at minimum, import/compile
|
||||||
check)
|
check)
|
||||||
- [ ] `make check` passes on current branch
|
- [ ] `make check` passes on current branch
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ are thin shims calling them. Model scripts:
|
|||||||
installs
|
installs
|
||||||
- [ ] `script/setup` / `make setup` — readies a fresh clone: runs `bootstrap`,
|
- [ ] `script/setup` / `make setup` — readies a fresh clone: runs `bootstrap`,
|
||||||
then `install-precommit`, plus repo-specific init
|
then `install-precommit`, plus repo-specific init
|
||||||
- [ ] `script/test` / `make test` — runs real tests, not a no-op (30-second
|
- [ ] `script/test` / `make test` — runs real tests, not a no-op (90-second
|
||||||
timeout)
|
timeout, 60-second hard cap on wall time)
|
||||||
- [ ] `script/lint` / `make lint` — runs the linter directly when
|
- [ ] `script/lint` / `make lint` — runs the linter directly when
|
||||||
`LINT_IN_CONTAINER=1`, otherwise `epoch="$(date +%s%N)$$"` on its own line
|
`LINT_IN_CONTAINER=1`, otherwise `epoch="$(date +%s%N)$$"` on its own line
|
||||||
then `docker build --build-arg CHECK_EPOCH="$epoch" -f Dockerfile.lint .`.
|
then `docker build --build-arg CHECK_EPOCH="$epoch" -f Dockerfile.lint .`.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Repository Policies
|
title: Repository Policies
|
||||||
last_modified: 2026-08-10
|
last_modified: 2026-08-19
|
||||||
---
|
---
|
||||||
|
|
||||||
This document covers repository structure, tooling, and workflow standards. Code
|
This document covers repository structure, tooling, and workflow standards. Code
|
||||||
@@ -467,8 +467,13 @@ style conventions are in separate documents:
|
|||||||
module under test to verify it compiles/parses. There is no excuse for
|
module under test to verify it compiles/parses. There is no excuse for
|
||||||
`make test` to be a no-op.
|
`make test` to be a no-op.
|
||||||
|
|
||||||
- `make test` must complete in under 20 seconds. Add a 30-second timeout in the
|
- `make test` must complete in under 60 seconds. That is the hard cap, and a
|
||||||
Makefile.
|
suite that exceeds it fails. Under 20 seconds is the target. A suite between
|
||||||
|
20 and 60 seconds is still green, but the overage must be filed as an
|
||||||
|
improvement bug against that repo. Add a 90-second timeout to the test
|
||||||
|
invocation in the Makefile (`go test -timeout 90s`). The backstop deliberately
|
||||||
|
sits above the hard cap so that it catches a genuinely hung test rather than a
|
||||||
|
merely slow one.
|
||||||
|
|
||||||
- **`make test` should use the conditional verbose rerun pattern.** Run tests
|
- **`make test` should use the conditional verbose rerun pattern.** Run tests
|
||||||
without `-v` (verbose) first. If tests fail, automatically rerun with `-v` to
|
without `-v` (verbose) first. If tests fail, automatically rerun with `-v` to
|
||||||
@@ -487,9 +492,9 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
test:
|
test:
|
||||||
@go test -timeout 30s -race -cover ./... || \
|
@go test -timeout 90s -race -cover ./... || \
|
||||||
{ echo "--- Rerunning with -v for details ---"; \
|
{ echo "--- Rerunning with -v for details ---"; \
|
||||||
go test -timeout 30s -race -v ./...; exit 1; }
|
go test -timeout 90s -race -v ./...; exit 1; }
|
||||||
```
|
```
|
||||||
|
|
||||||
Python example:
|
Python example:
|
||||||
@@ -666,10 +671,14 @@ style conventions are in separate documents:
|
|||||||
- Make all changes on a feature branch. You can do whatever you want on a
|
- Make all changes on a feature branch. You can do whatever you want on a
|
||||||
feature branch.
|
feature branch.
|
||||||
|
|
||||||
- `.golangci.yml` is standardized and must _NEVER_ be modified by an agent, only
|
- `.golangci.yml` is standardized. The vendored copy in a consuming repo must
|
||||||
manually by the user. Fetch from
|
_NEVER_ be modified by an agent: fetch it from
|
||||||
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`. The
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml` and keep it
|
||||||
canonical golangci-lint version is v2.12.2 (released 2026-05-06), pinned as
|
byte-identical, so that no repo can quietly loosen its own linting. Linter
|
||||||
|
configuration changes are made to the canonical copy in the `prompts` repo and
|
||||||
|
reach consuming repos by re-vendoring; an agent may open a PR against
|
||||||
|
canonical, which only the user merges. The canonical golangci-lint version is
|
||||||
|
v2.12.2 (released 2026-05-06), pinned as
|
||||||
the image digest in `Dockerfile.lint`
|
the image digest in `Dockerfile.lint`
|
||||||
(`golangci/golangci-lint@sha256:5cceeef04e53efe1470638d4b4b4f5ceefd574955ab3941b2d9a68a8c9ad5240`,
|
(`golangci/golangci-lint@sha256:5cceeef04e53efe1470638d4b4b4f5ceefd574955ab3941b2d9a68a8c9ad5240`,
|
||||||
which reports
|
which reports
|
||||||
@@ -892,7 +901,9 @@ style conventions are in separate documents:
|
|||||||
language-specific config). Everything else goes in a subdirectory. Canonical
|
language-specific config). Everything else goes in a subdirectory. Canonical
|
||||||
subdirectory names:
|
subdirectory names:
|
||||||
- `bin/` — executable scripts and tools
|
- `bin/` — executable scripts and tools
|
||||||
- `cmd/` — Go command entrypoints
|
- `cmd/` — Go command entrypoints; thin only: one `main.go` per binary whose
|
||||||
|
body is a single call into `internal/` or `pkg/`, no project logic in
|
||||||
|
`cmd/`
|
||||||
- `configs/` — configuration templates and examples
|
- `configs/` — configuration templates and examples
|
||||||
- `deploy/` — deployment manifests (k8s, compose, terraform)
|
- `deploy/` — deployment manifests (k8s, compose, terraform)
|
||||||
- `docs/` — documentation and markdown (README.md stays in root)
|
- `docs/` — documentation and markdown (README.md stays in root)
|
||||||
|
|||||||
Reference in New Issue
Block a user