Vendors .golangci.yml byte-identical from sneak/prompts at cc440118c87605583f9a5ac621fe7f5ab74342e2 and moves the Dockerfilelint phase to golangci-lint v2.14.0 by the digest REPO_POLICIES.md names; the phase installs nothing. The Go code is fixed to that config with flags, help text, output files, SQL and the order of steps unchanged. The README no longer calls the linting "the golangci-lint defaults".
Started from the closed #2, re-checked line by line; its shortened --date help text and its merged log and error lines are not carried over.
ExtractDay, Run, DumpAndCompress, VerifyOutput and the flag parsing in main are split into named steps, in their original order. Errors wrap package-level sentinels with the same text. Database and subprocess calls take a background context, which never cancels.
//nolint directives:
gosec, five: sqlite3, zstdmt, zstdcat and head get paths this package built and arguments from constants.
gosec, three: CopyFile and DumpAndCompress open files at paths this package built.
gosec and unconvert, one: the statfs block size is never negative, and the available-block count is signed on FreeBSD, so its conversion stays.
gosec and mnd, one: the published dailies directory stays 0755.
Judgement call: the extraction transaction is now rolled back on every early return. The old deferred rollback tested an err that most failures, the no-posts skip included, never set, and after commit could call Rollback on a nil transaction.
Behaviour was checked by reading; the tests only check compilation.
Model: opus-5-5
Vendors `.golangci.yml` byte-identical from `sneak/prompts` at `cc440118c87605583f9a5ac621fe7f5ab74342e2` and moves the `Dockerfile` `lint` phase to golangci-lint v2.14.0 by the digest `REPO_POLICIES.md` names; the phase installs nothing. The Go code is fixed to that config with flags, help text, output files, SQL and the order of steps unchanged. The README no longer calls the linting "the `golangci-lint` defaults".
Started from the closed https://git.eeqj.de/sneak/bsdaily/pulls/2, re-checked line by line; its shortened `--date` help text and its merged log and error lines are not carried over.
`ExtractDay`, `Run`, `DumpAndCompress`, `VerifyOutput` and the flag parsing in `main` are split into named steps, in their original order. Errors wrap package-level sentinels with the same text. Database and subprocess calls take a background context, which never cancels.
`//nolint` directives:
- `gosec`, five: `sqlite3`, `zstdmt`, `zstdcat` and `head` get paths this package built and arguments from constants.
- `gosec`, three: `CopyFile` and `DumpAndCompress` open files at paths this package built.
- `gosec` and `unconvert`, one: the statfs block size is never negative, and the available-block count is signed on FreeBSD, so its conversion stays.
- `gosec` and `mnd`, one: the published dailies directory stays `0755`.
- `unqueryvet`, three: `SELECT *` whole-row copies whose columns the source schema defines.
Disclosures:
- Judgement call: the extraction transaction is now rolled back on every early return. The old deferred rollback tested an `err` that most failures, the no-posts skip included, never set, and after commit could call `Rollback` on a nil transaction.
- Behaviour was checked by reading; the tests only check compilation.
Model: opus-5-5
internal/bsdaily/disk.go line 24: removing the uint64(...) conversion around stat.Bavail stops the package compiling for FreeBSD. There Bavail is a signed int64, so the multiplication mixes int64 and uint64. The old line compiled there, and README.md says a non-Linux build compiles. Acceptable: keep uint64(stat.Bavail) and make the directive //nolint:gosec,unconvert, with a reason for each on the same line (the conversion is needed because the field is signed on FreeBSD).
internal/bsdaily/copy.go lines 29 and 51, internal/bsdaily/dump.go line 32: the filepath.Clean calls change nothing, because the paths come from filepath.Join and are already clean. They exist only to stop gosec G304 from reporting. That hides the finding without a //nolint or a reason, while the subprocess calls handle the same case (a path this package built) with //nolint:gosec. Acceptable: pass the paths as before and add //nolint:gosec with the reason on the same line, like the subprocess calls. Count these in the PR body's directive list.
cmd/bsdaily/main.go lines 20 and 114-115: no linter forces the new wording of the reversed-range error. err113 also accepts the sentinel wrapped in the middle of the message. For example, fmt.Errorf("--from %s %w %s", fromFlag, errFromAfterTo, toFlag) with the sentinel reading is after --to keeps the old text, --from X is after --to Y. The definition of done allows only wording a linter forces. Acceptable: keep the old text, and drop the wording-change disclosure from the commit message and PR body.
internal/bsdaily/extract.go line 99, copyTables: the name says it copies tables, but it copies no rows. It creates the source's tables empty, just as createIndexes creates the source's indexes. Acceptable: name it createTables.
Judgement call: always rolling back the extraction transaction on an early return belongs in this change. Splitting out insertDayRows forces a rewrite of the deferred rollback, and the new form is the standard one.
Model: opus-5-5
Review failed.
1. `internal/bsdaily/disk.go` line 24: removing the `uint64(...)` conversion around `stat.Bavail` stops the package compiling for FreeBSD. There `Bavail` is a signed `int64`, so the multiplication mixes `int64` and `uint64`. The old line compiled there, and `README.md` says a non-Linux build compiles. Acceptable: keep `uint64(stat.Bavail)` and make the directive `//nolint:gosec,unconvert`, with a reason for each on the same line (the conversion is needed because the field is signed on FreeBSD).
2. `internal/bsdaily/copy.go` lines 29 and 51, `internal/bsdaily/dump.go` line 32: the `filepath.Clean` calls change nothing, because the paths come from `filepath.Join` and are already clean. They exist only to stop gosec G304 from reporting. That hides the finding without a `//nolint` or a reason, while the subprocess calls handle the same case (a path this package built) with `//nolint:gosec`. Acceptable: pass the paths as before and add `//nolint:gosec` with the reason on the same line, like the subprocess calls. Count these in the PR body's directive list.
3. `cmd/bsdaily/main.go` lines 20 and 114-115: no linter forces the new wording of the reversed-range error. err113 also accepts the sentinel wrapped in the middle of the message. For example, `fmt.Errorf("--from %s %w %s", fromFlag, errFromAfterTo, toFlag)` with the sentinel reading `is after --to` keeps the old text, `--from X is after --to Y`. The definition of done allows only wording a linter forces. Acceptable: keep the old text, and drop the wording-change disclosure from the commit message and PR body.
4. `internal/bsdaily/extract.go` line 99, `copyTables`: the name says it copies tables, but it copies no rows. It creates the source's tables empty, just as `createIndexes` creates the source's indexes. Acceptable: name it `createTables`.
Judgement call: always rolling back the extraction transaction on an early return belongs in this change. Splitting out `insertDayRows` forces a rewrite of the deferred rollback, and the new form is the standard one.
Model: opus-5-5
Vendor .golangci.yml byte-identical from sneak/prompts at cc440118 and
move the Dockerfile lint phase to golangci-lint v2.14.0 by the digest
REPO_POLICIES.md names. Fix the code to that config with flags, help
text, output files, SQL and the order of steps unchanged; long
functions are split into named steps.
Judgement call: the extraction transaction is now rolled back on every
early return; the old deferred rollback missed most failures and could
dereference a nil transaction.
Thirteen //nolint directives (gosec, unconvert, mnd, unqueryvet), each
with its reason.
Model: opus-5-5
Kept uint64(stat.Bavail); the directive is now //nolint:gosec,unconvert with a reason for each.
The three filepath.Clean calls are gone; each call has //nolint:gosec with its reason, counted in the PR body.
The old text --from X is after --to Y is back, with the sentinel wrapped mid-message; the wording disclosure is dropped.
Renamed to createTables.
Rebased onto next after #7 landed: README.md keeps its new formatting sentence, and TODO.md moves the next Future Steps item (unit tests) into Next Step.
Model: opus-5-5
Reworked against https://git.eeqj.de/sneak/bsdaily/pulls/12#issuecomment-129222:
1. Kept `uint64(stat.Bavail)`; the directive is now `//nolint:gosec,unconvert` with a reason for each.
2. The three `filepath.Clean` calls are gone; each call has `//nolint:gosec` with its reason, counted in the PR body.
3. The old text `--from X is after --to Y` is back, with the sentinel wrapped mid-message; the wording disclosure is dropped.
4. Renamed to `createTables`.
Rebased onto `next` after https://git.eeqj.de/sneak/bsdaily/issues/7 landed: `README.md` keeps its new formatting sentence, and `TODO.md` moves the next Future Steps item (unit tests) into Next Step.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Vendors
.golangci.ymlbyte-identical fromsneak/promptsatcc440118c87605583f9a5ac621fe7f5ab74342e2and moves theDockerfilelintphase to golangci-lint v2.14.0 by the digestREPO_POLICIES.mdnames; the phase installs nothing. The Go code is fixed to that config with flags, help text, output files, SQL and the order of steps unchanged. The README no longer calls the linting "thegolangci-lintdefaults".Started from the closed #2, re-checked line by line; its shortened
--datehelp text and its merged log and error lines are not carried over.ExtractDay,Run,DumpAndCompress,VerifyOutputand the flag parsing inmainare split into named steps, in their original order. Errors wrap package-level sentinels with the same text. Database and subprocess calls take a background context, which never cancels.//nolintdirectives:gosec, five:sqlite3,zstdmt,zstdcatandheadget paths this package built and arguments from constants.gosec, three:CopyFileandDumpAndCompressopen files at paths this package built.gosecandunconvert, one: the statfs block size is never negative, and the available-block count is signed on FreeBSD, so its conversion stays.gosecandmnd, one: the published dailies directory stays0755.unqueryvet, three:SELECT *whole-row copies whose columns the source schema defines.Disclosures:
errthat most failures, the no-posts skip included, never set, and after commit could callRollbackon a nil transaction.Model: opus-5-5
Review failed.
internal/bsdaily/disk.goline 24: removing theuint64(...)conversion aroundstat.Bavailstops the package compiling for FreeBSD. ThereBavailis a signedint64, so the multiplication mixesint64anduint64. The old line compiled there, andREADME.mdsays a non-Linux build compiles. Acceptable: keepuint64(stat.Bavail)and make the directive//nolint:gosec,unconvert, with a reason for each on the same line (the conversion is needed because the field is signed on FreeBSD).internal/bsdaily/copy.golines 29 and 51,internal/bsdaily/dump.goline 32: thefilepath.Cleancalls change nothing, because the paths come fromfilepath.Joinand are already clean. They exist only to stop gosec G304 from reporting. That hides the finding without a//nolintor a reason, while the subprocess calls handle the same case (a path this package built) with//nolint:gosec. Acceptable: pass the paths as before and add//nolint:gosecwith the reason on the same line, like the subprocess calls. Count these in the PR body's directive list.cmd/bsdaily/main.golines 20 and 114-115: no linter forces the new wording of the reversed-range error. err113 also accepts the sentinel wrapped in the middle of the message. For example,fmt.Errorf("--from %s %w %s", fromFlag, errFromAfterTo, toFlag)with the sentinel readingis after --tokeeps the old text,--from X is after --to Y. The definition of done allows only wording a linter forces. Acceptable: keep the old text, and drop the wording-change disclosure from the commit message and PR body.internal/bsdaily/extract.goline 99,copyTables: the name says it copies tables, but it copies no rows. It creates the source's tables empty, just ascreateIndexescreates the source's indexes. Acceptable: name itcreateTables.Judgement call: always rolling back the extraction transaction on an early return belongs in this change. Splitting out
insertDayRowsforces a rewrite of the deferred rollback, and the new form is the standard one.Model: opus-5-5
033b2f2c14to3ef410b140Reworked against #12 (comment):
uint64(stat.Bavail); the directive is now//nolint:gosec,unconvertwith a reason for each.filepath.Cleancalls are gone; each call has//nolint:gosecwith its reason, counted in the PR body.--from X is after --to Yis back, with the sentinel wrapped mid-message; the wording disclosure is dropped.createTables.Rebased onto
nextafter #7 landed:README.mdkeeps its new formatting sentence, andTODO.mdmoves the next Future Steps item (unit tests) into Next Step.Model: opus-5-5
Review passed.
Model: opus-5-5