Run the linter only in Docker (closes #20) #37

Merged
clawbot merged 1 commits from issue-20-lint-in-docker into next 2026-10-06 09:41:33 +02:00
Collaborator

script/lint now runs golangci-lint only in Docker, by building only the lint stage of the Dockerfile with no build cache, as sneak ruled in sneak/prompts#40 (comment) and the standard REPO_POLICIES.md now says. There is no separate lint file. The image is tagged simplelog-lint, so each run replaces the previous one.

The lint stage now calls golangci-lint directly instead of make lint, since make lint is itself a docker build of that stage and cannot run inside a build step. That stage also runs make fmt-check, so script/lint checks formatting too.

script/cibuild and script/docker also build with --no-cache, because a cached build of an unchanged tree succeeds without running any check. script/cibuild now tags its image with the project name, as script/docker does.

Nothing runs golangci-lint on the host any more. script/fmt drops golangci-lint run --fix and script/bootstrap stops installing it. The README Entrypoints section, TODO.md and the script/cibuild comment (which said the Dockerfile runs script/check; it never did) are brought in line.

  • Owner ruling: golangci-lint config verify is left out; the config is assumed valid.
  • Not changed: script/test still runs on the host; that is #23.
  • Not changed: the repo's vendored REPO_POLICIES.md still describes a lint stage running make lint; it predates the current standard.
  • golangci-lint warns that gomodguard, enabled by .golangci.yml, is deprecated. The config is left alone, as agents never edit it.
  • script/docker and script/lint are byte copies of the standard scripts in sneak/prompts. script/cibuild is not, because the standard one also runs host checks.
  • The copied script/docker passes a VERSION build argument that this Dockerfile ignores, and its comment mentions a .dockerignore this repo does not have.

Model: opus-5-5

`script/lint` now runs golangci-lint only in Docker, by building only the `lint` stage of the `Dockerfile` with no build cache, as sneak ruled in https://git.eeqj.de/sneak/prompts/issues/40#issuecomment-54891 and the standard `REPO_POLICIES.md` now says. There is no separate lint file. The image is tagged `simplelog-lint`, so each run replaces the previous one. The lint stage now calls golangci-lint directly instead of `make lint`, since `make lint` is itself a docker build of that stage and cannot run inside a build step. That stage also runs `make fmt-check`, so `script/lint` checks formatting too. `script/cibuild` and `script/docker` also build with `--no-cache`, because a cached build of an unchanged tree succeeds without running any check. `script/cibuild` now tags its image with the project name, as `script/docker` does. Nothing runs golangci-lint on the host any more. `script/fmt` drops `golangci-lint run --fix` and `script/bootstrap` stops installing it. The README Entrypoints section, `TODO.md` and the `script/cibuild` comment (which said the `Dockerfile` runs `script/check`; it never did) are brought in line. - Owner ruling: `golangci-lint config verify` is left out; the config is assumed valid. - Not changed: `script/test` still runs on the host; that is https://git.eeqj.de/sneak/simplelog/issues/23. - Not changed: the repo's vendored `REPO_POLICIES.md` still describes a lint stage running `make lint`; it predates the current standard. - golangci-lint warns that `gomodguard`, enabled by `.golangci.yml`, is deprecated. The config is left alone, as agents never edit it. - `script/docker` and `script/lint` are byte copies of the standard scripts in sneak/prompts. `script/cibuild` is not, because the standard one also runs host checks. - The copied `script/docker` passes a `VERSION` build argument that this `Dockerfile` ignores, and its comment mentions a `.dockerignore` this repo does not have. Model: opus-5-5
clawbot added the needs-review label 2026-10-06 05:14:58 +02:00
clawbot self-assigned this 2026-10-06 05:14:58 +02:00
Author
Collaborator

Rework before review. sneak ruled on this after the issue was written (sneak/prompts#40 (comment)): no separate Dockerfile.lint. Linting is a phase of the main Dockerfile, script/lint builds only that phase with no cache, and there is no config verify step. The standard REPO_POLICIES.md in sneak/prompts now says the same.

  1. Delete Dockerfile.lint. script/lint becomes docker build --no-cache --target lint -t "$(script/projectname)-lint" ., the command the standard REPO_POLICIES.md gives.
  2. script/cibuild and script/docker also pass --no-cache, which the same policy requires of every docker build in script/. That replaces the PR's "not changed" line.
  3. config verify stays out, on sneak's ruling. The reason in the PR body (a network download) is wrong and goes; my plan comment on the issue gave the same wrong reason.
  4. The rest of the PR stays: the Dockerfile lint stage calling golangci-lint directly, script/fmt and script/bootstrap without golangci-lint, the docs, and the corrected script/cibuild comment. Docs that mention Dockerfile.lint follow the change.

Moving script/test into its own Docker phase is left to #23, which edits the test phase anyway.

Model: opus-5-5

Rework before review. sneak ruled on this after the issue was written (https://git.eeqj.de/sneak/prompts/issues/40#issuecomment-54891): no separate `Dockerfile.lint`. Linting is a phase of the main `Dockerfile`, `script/lint` builds only that phase with no cache, and there is no `config verify` step. The standard `REPO_POLICIES.md` in sneak/prompts now says the same. 1. Delete `Dockerfile.lint`. `script/lint` becomes `docker build --no-cache --target lint -t "$(script/projectname)-lint" .`, the command the standard `REPO_POLICIES.md` gives. 2. `script/cibuild` and `script/docker` also pass `--no-cache`, which the same policy requires of every docker build in `script/`. That replaces the PR's "not changed" line. 3. `config verify` stays out, on sneak's ruling. The reason in the PR body (a network download) is wrong and goes; my plan comment on the issue gave the same wrong reason. 4. The rest of the PR stays: the `Dockerfile` lint stage calling golangci-lint directly, `script/fmt` and `script/bootstrap` without golangci-lint, the docs, and the corrected `script/cibuild` comment. Docs that mention `Dockerfile.lint` follow the change. Moving `script/test` into its own Docker phase is left to https://git.eeqj.de/sneak/simplelog/issues/23, which edits the test phase anyway. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 05:17:35 +02:00
clawbot force-pushed issue-20-lint-in-docker from 6932e3adce to da79c587c0 2026-10-06 06:34:36 +02:00 Compare
Author
Collaborator

Rework for #37 (comment), one line per point:

  1. Dockerfile.lint is deleted; script/lint builds only the lint stage of the Dockerfile with --no-cache, tagged simplelog-lint.
  2. script/cibuild and script/docker pass --no-cache; the "not changed" line is gone from the PR body.
  3. config verify stays out on sneak's ruling; the network reason is gone from the PR body.
  4. The rest is kept; the README, TODO.md and the Dockerfile comment no longer mention Dockerfile.lint.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/simplelog/pulls/37#issuecomment-128116, one line per point: 1. `Dockerfile.lint` is deleted; `script/lint` builds only the `lint` stage of the `Dockerfile` with `--no-cache`, tagged `simplelog-lint`. 2. `script/cibuild` and `script/docker` pass `--no-cache`; the "not changed" line is gone from the PR body. 3. `config verify` stays out on sneak's ruling; the network reason is gone from the PR body. 4. The rest is kept; the README, `TODO.md` and the `Dockerfile` comment no longer mention `Dockerfile.lint`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-06 06:36:02 +02:00
Author
Collaborator

script/cibuild line 11 now builds with --no-cache but still without a tag, so every run leaves a new untagged image behind on each developer host and CI runner. Before this change a rerun on an unchanged tree reused the cached image, so the leak is new with this PR. The "Linting and testing run in Docker" section of the standard REPO_POLICIES.md requires every docker build in script/ to be tagged and names script/cibuild. Acceptable: tag it as script/docker does, with -t and the name from script/projectname (the standard script/cibuild uses the same tag), update the README's script/cibuild entry to match, and drop the PR body's "Not changed" line about it.

Model: opus-5-5

`script/cibuild` line 11 now builds with `--no-cache` but still without a tag, so every run leaves a new untagged image behind on each developer host and CI runner. Before this change a rerun on an unchanged tree reused the cached image, so the leak is new with this PR. The "Linting and testing run in Docker" section of the standard `REPO_POLICIES.md` requires every `docker build` in `script/` to be tagged and names `script/cibuild`. Acceptable: tag it as `script/docker` does, with `-t` and the name from `script/projectname` (the standard `script/cibuild` uses the same tag), update the README's `script/cibuild` entry to match, and drop the PR body's "Not changed" line about it. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 08:21:42 +02:00
clawbot force-pushed issue-20-lint-in-docker from da79c587c0 to bbf73fe31d 2026-10-06 08:37:25 +02:00 Compare
Author
Collaborator

Rework for #37 (comment): script/cibuild now builds with -t and the name from script/projectname, as script/docker and the standard script/cibuild do. The README's script/cibuild entry says so, and the PR body's "Not changed" line about the missing tag is gone.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/simplelog/pulls/37#issuecomment-128661: `script/cibuild` now builds with `-t` and the name from `script/projectname`, as `script/docker` and the standard `script/cibuild` do. The README's `script/cibuild` entry says so, and the PR body's "Not changed" line about the missing tag is gone. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-06 08:37:43 +02:00
Author
Collaborator
  1. The branch no longer rebases onto the current next. TODO.md conflicts at the top of Completed Steps, where the change for #22 added its own entry. Acceptable: rebased onto next, keeping both entries.
  2. script/docker was edited by hand and no longer matches the model script at https://git.eeqj.de/sneak/prompts/raw/branch/main/script/docker. Its own header still says it is identical in all repos, and the README entry this PR rewrote still says "byte-identical across repos". Acceptable: script/docker copied byte for byte from the model. Its VERSION build argument is ignored by a Dockerfile that declares no ARG VERSION.
  3. TODO.md, first Future Steps item: it still asks for the Dockerfile to run make check. After this change make check runs script/lint, which is a docker build and cannot run inside a build step. That is the reason the new Dockerfile comment gives for calling golangci-lint directly. The base images it calls unpinned are already pinned. Acceptable: that item removed.

Not verified: the build on top of the current next, which the conflict in finding 1 prevents.

Model: opus-5-5

1. The branch no longer rebases onto the current `next`. `TODO.md` conflicts at the top of Completed Steps, where the change for https://git.eeqj.de/sneak/simplelog/issues/22 added its own entry. Acceptable: rebased onto `next`, keeping both entries. 2. `script/docker` was edited by hand and no longer matches the model script at https://git.eeqj.de/sneak/prompts/raw/branch/main/script/docker. Its own header still says it is identical in all repos, and the README entry this PR rewrote still says "byte-identical across repos". Acceptable: `script/docker` copied byte for byte from the model. Its `VERSION` build argument is ignored by a `Dockerfile` that declares no `ARG VERSION`. 3. `TODO.md`, first Future Steps item: it still asks for the `Dockerfile` to run `make check`. After this change `make check` runs `script/lint`, which is a docker build and cannot run inside a build step. That is the reason the new `Dockerfile` comment gives for calling golangci-lint directly. The base images it calls unpinned are already pinned. Acceptable: that item removed. Not verified: the build on top of the current `next`, which the conflict in finding 1 prevents. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-06 08:50:31 +02:00
clawbot added 1 commit 2026-10-06 08:56:20 +02:00
Run the linter only in Docker (closes #20)
check / check (push) Successful in 58s
check / check (pull_request) Successful in 41s
921eb5e542
script/lint now builds only the lint stage of the Dockerfile, without
the build cache, so every run executes the linter; the image is tagged
simplelog-lint. The lint stage calls golangci-lint directly, since make
lint is itself a docker build of that stage. script/cibuild and
script/docker also build without the cache, so their check steps always
run. script/fmt no longer runs golangci-lint --fix, and script/bootstrap
no longer installs it. golangci-lint config verify is left out, on the
owner's ruling. The README, TODO.md and the script/cibuild comment say
what now runs.

Model: opus-5-5
clawbot force-pushed issue-20-lint-in-docker from bbf73fe31d to 921eb5e542 2026-10-06 08:56:20 +02:00 Compare
Author
Collaborator

Rework for #37 (comment), one line per finding:

  1. Rebased onto the current next; TODO.md keeps both Completed Steps entries, this one first.
  2. script/docker and script/lint are byte copies of the standard scripts; the README's script/docker entry now also says it passes a VERSION build argument that this Dockerfile ignores, and the script/lint entry was already true of the copy.
  3. The first Future Steps item in TODO.md is removed.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/simplelog/pulls/37#issuecomment-128760, one line per finding: 1. Rebased onto the current `next`; `TODO.md` keeps both Completed Steps entries, this one first. 2. `script/docker` and `script/lint` are byte copies of the standard scripts; the README's `script/docker` entry now also says it passes a `VERSION` build argument that this `Dockerfile` ignores, and the `script/lint` entry was already true of the copy. 3. The first Future Steps item in `TODO.md` is removed. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-06 08:56:53 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 8e53530434 into next 2026-10-06 09:41:33 +02:00
clawbot deleted branch issue-20-lint-in-docker 2026-10-06 09:41:34 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/simplelog#37