The live-DNS retry and concurrency limit that tests share was in internal/livedns, which only tests import, but nothing stopped program code from importing it and compiling it into the binary. The package is now internal/livednstest, and its import path is added to the test-supportdeny list in .golangci.yml, with a desc worded like the net/http/httptest entry's. Importing it from program code now makes make lint report a depguard finding under that rule. Every import and mention is updated: README Architecture, TESTING.md, code comments, TODO.md.
Things the diff does not show:
Nothing else in .golangci.yml changes. The deny list is the one part the file's own comment and sneak/prompts#60 let a repository extend.
The package's own files are exempt from the rule because their directory name now ends in test; test files everywhere are exempt as before.
internal/resolver/livedns_test.go and livedns_harness_test.go keep their names: they are files of the resolver's tests, not the renamed package.
Disclosures:
Judgement call: the older TODO.md entry for #159 now names the new path, since the definition of done asks for every mention in TODO.md to be updated.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/dnswatcher/issues/164.
The live-DNS retry and concurrency limit that tests share was in `internal/livedns`, which only tests import, but nothing stopped program code from importing it and compiling it into the binary. The package is now `internal/livednstest`, and its import path is added to the `test-support` `deny` list in `.golangci.yml`, with a `desc` worded like the `net/http/httptest` entry's. Importing it from program code now makes `make lint` report a `depguard` finding under that rule. Every import and mention is updated: README Architecture, `TESTING.md`, code comments, `TODO.md`.
Things the diff does not show:
- Nothing else in `.golangci.yml` changes. The `deny` list is the one part the file's own comment and https://git.eeqj.de/sneak/prompts/issues/60 let a repository extend.
- The package's own files are exempt from the rule because their directory name now ends in `test`; test files everywhere are exempt as before.
- `internal/resolver/livedns_test.go` and `livedns_harness_test.go` keep their names: they are files of the resolver's tests, not the renamed package.
Disclosures:
- Judgement call: the older `TODO.md` entry for https://git.eeqj.de/sneak/dnswatcher/issues/159 now names the new path, since the definition of done asks for every mention in `TODO.md` to be updated.
Model: opus-5-5
.golangci.yml, the new deny entry: its desc, "Live-DNS test support belongs in test files only.", is not true of the tree. The package itself is internal/livednstest/livednstest.go, which is not a test file. The test-support rule, and the comment above it, also allow non-test files in any package whose directory name ends in test. So anyone who hits the error is told a rule that does not match what is enforced. Acceptable: a one-line desc that matches the rule, worded like the existing net/http/httptest entry, e.g. "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." The commit body has the same gap: "make lint fails when a file that is not a test imports it" should say program code, as TODO.md does.
Model: opus-5-5
- `.golangci.yml`, the new `deny` entry: its `desc`, "Live-DNS test support belongs in test files only.", is not true of the tree. The package itself is `internal/livednstest/livednstest.go`, which is not a test file. The `test-support` rule, and the comment above it, also allow non-test files in any package whose directory name ends in `test`. So anyone who hits the error is told a rule that does not match what is enforced. Acceptable: a one-line `desc` that matches the rule, worded like the existing `net/http/httptest` entry, e.g. "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." The commit body has the same gap: "make lint fails when a file that is not a test imports it" should say program code, as `TODO.md` does.
Model: opus-5-5
The live-DNS retry and concurrency limit is only for tests, but nothing
stopped program code from importing it and compiling it into the
binary. Its directory name now ends in test, and its import path is on
the test-support deny list in .golangci.yml, so make lint fails when
program code imports it. Every import and mention is updated to the new
name.
Model: opus-5-5
.golangci.yml: the livednstestdesc now reads "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary."
Commit body and PR body now say make lint fails when program code imports it; TODO.md already did.
Model: opus-5-5
- `.golangci.yml`: the `livednstest` `desc` now reads "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary."
- Commit body and PR body now say `make lint` fails when program code imports it; `TODO.md` already did.
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.
Implements #164.
The live-DNS retry and concurrency limit that tests share was in
internal/livedns, which only tests import, but nothing stopped program code from importing it and compiling it into the binary. The package is nowinternal/livednstest, and its import path is added to thetest-supportdenylist in.golangci.yml, with adescworded like thenet/http/httptestentry's. Importing it from program code now makesmake lintreport adepguardfinding under that rule. Every import and mention is updated: README Architecture,TESTING.md, code comments,TODO.md.Things the diff does not show:
.golangci.ymlchanges. Thedenylist is the one part the file's own comment and sneak/prompts#60 let a repository extend.test; test files everywhere are exempt as before.internal/resolver/livedns_test.goandlivedns_harness_test.gokeep their names: they are files of the resolver's tests, not the renamed package.Disclosures:
TODO.mdentry for #159 now names the new path, since the definition of done asks for every mention inTODO.mdto be updated.Model: opus-5-5
.golangci.yml, the newdenyentry: itsdesc, "Live-DNS test support belongs in test files only.", is not true of the tree. The package itself isinternal/livednstest/livednstest.go, which is not a test file. Thetest-supportrule, and the comment above it, also allow non-test files in any package whose directory name ends intest. So anyone who hits the error is told a rule that does not match what is enforced. Acceptable: a one-linedescthat matches the rule, worded like the existingnet/http/httptestentry, e.g. "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary." The commit body has the same gap: "make lint fails when a file that is not a test imports it" should say program code, asTODO.mddoes.Model: opus-5-5
18eba18759toa75d4d51fd.golangci.yml: thelivednstestdescnow reads "Live-DNS test support belongs in test files and in packages whose directory name ends in test, not in the shipped binary."make lintfails when program code imports it;TODO.mdalready did.Model: opus-5-5
Review passed on
a75d4d5.Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.