Re-vendor the canonical files from sneak/prompts dd4027b (closes #159, closes #116)
check / check (push) Failing after 4s
check / check (push) Failing after 4s
Fetches .dockerignore, .editorconfig, the CI workflow, .gitignore, .golangci.yml, .prettierignore, .prettierrc and REPO_POLICIES.md byte for byte from sneak/prompts dd4027b; this repo's own entries follow the canonical text in .dockerignore, .gitignore and .editorconfig. The new .golangci.yml disables gomodguard. The Dockerfile gets a lint phase on golangci-lint v2.14.0 and a test phase on the Debian Go image; the build stage depends on both and stamps the version as the policy shows. script/test and script/lint build only their phase, and script/cibuild bootstraps and runs script/check first. bin/tools goes: script/bootstrap installs gofumpt and protoc-gen-go into bin/ with go install pinned to a commit. Model: opus-5-5
This commit is contained in:
+12
-9
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
# script/lint: run golangci-lint, in Docker only. Builds the lint stage of
|
||||
# the Dockerfile, whose build runs the linter, so a successful build is a
|
||||
# clean lint. --no-cache because a cached build runs no linter. The image
|
||||
# is removed afterwards, whatever the outcome.
|
||||
# script/lint: run the linter. Linting is a phase of the Dockerfile and
|
||||
# this builds that phase alone; the linter is never installed or run on
|
||||
# a developer host, where a shared result cache and a host-global lock
|
||||
# make its answer untrustworthy.
|
||||
#
|
||||
# The phase is not the last stage in the file, so it is built only when
|
||||
# --target names it. --no-cache because a cached lint layer is a lint
|
||||
# that did not run. The tag makes each build replace the previous image
|
||||
# instead of leaving a dangling one behind.
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
@@ -10,11 +15,9 @@ ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
# Tagged per run, so concurrent runs never remove each other's image.
|
||||
image="$("$SCRIPT_DIR/projectname")-lint:$$"
|
||||
# A failed build leaves no image, so there is nothing to remove then.
|
||||
trap 'docker image rm "$image" >/dev/null 2>&1 || true' EXIT INT TERM
|
||||
docker build --no-cache --target lint -t "$image" .
|
||||
docker build --no-cache \
|
||||
--target lint \
|
||||
-t "$("$SCRIPT_DIR/projectname")-lint" .
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user