Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims
This commit is contained in:
34
README.md
34
README.md
@@ -60,6 +60,40 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
## Entrypoints
|
||||
|
||||
This repository adheres to the
|
||||
[Scripts to Rule Them All](https://github.com/github/scripts-to-rule-them-all)
|
||||
standard: normalized scripts in `script/` are the entrypoints for the
|
||||
development workflow, and the Makefile targets are thin shims that call them.
|
||||
The scripts are POSIX sh (not bash) so they run in minimal containers such as
|
||||
alpine. We provide:
|
||||
|
||||
- `script/bootstrap` — install all dependencies (go and golangci-lint if
|
||||
missing, then `go mod download`)
|
||||
- `script/setup` — set up the repo for development after a fresh clone: runs
|
||||
`script/bootstrap`, then `script/install-precommit`
|
||||
- `script/projectname` — output the project name (our own extension); used by
|
||||
`script/docker` for the image tag
|
||||
- `script/test` — run the test suite (`go test -v ./...`)
|
||||
- `script/lint` — run golangci-lint
|
||||
- `script/fmt` — format all files (goimports plus `golangci-lint run --fix`;
|
||||
writes)
|
||||
- `script/fmt-check` — check formatting (read-only); fails if `gofmt -l`
|
||||
reports files
|
||||
- `script/check` — run all checks: `test`, `lint`, `fmt-check` (our own
|
||||
extension)
|
||||
- `script/docker` — build the Docker image, tagged via `script/projectname`
|
||||
(byte-identical across repos)
|
||||
- `script/cibuild` — cd to the repo root and `docker build .` (what CI runs;
|
||||
the image build runs the checks)
|
||||
- `script/precommit` — run by the git pre-commit hook (our own extension);
|
||||
runs a `go mod tidy` guard, then `script/check`
|
||||
- `script/install-precommit` — installs the git pre-commit hook (our own
|
||||
extension); `make hooks` shims to it
|
||||
|
||||
`make hooks` installs the pre-commit hook that runs `script/precommit`.
|
||||
|
||||
## License
|
||||
|
||||
[WTFPL](./LICENSE)
|
||||
|
||||
Reference in New Issue
Block a user