Repository navigation
Conversation
The seven test files whose category C cyclop exceptions expired on 2026-11-22 now stay under the limits. The request checks and the per-field result checks of nine test functions move into t.Helper() functions, anidb's title search becomes a named table, every touched Test function has a doc comment, and the seven expired entries leave .golangci.yml. No assertion and no case was removed. Refs: #141 Signed-off-by: lusoris <lusoris@proton.me>
make lint-exceptions-gen re-measured all 72 modules and found 39 findings. The 19 baseline entries it drops all name the nine split tests, whose gocyclo, gocognit and funlen findings are gone. The diff only deletes lines. Refs: #141 Signed-off-by: lusoris <lusoris@proton.me>
The self-exception of tools/go/lintexceptions ran out on 2026-11-22, so TestThisCheckIsItselfCurrent failed on main and on every pull request. It moves to category D, entered 2026-11-23 and expiring 2027-03-23: the engine audit judges the same block in the local hooks, but CI runs no server-side praetorctl audit by adoption, so this check is the second barrier for the block in CI. Revisit when CI runs praetorctl audit. TestSelfExpiryHoldsThroughItsDay pins the boundary of the new date. The planted 2026-10-29 cases are unchanged. Refs: #141 Signed-off-by: lusoris <lusoris@proton.me>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Reviewer's GuideImplementationMove the lintexceptions self-expiry date and document why the CI guard remains until CI runs the praetorctl audit.
ConfigurationRemove the seven expired cyclop exceptions and the obsolete baseline entries for findings eliminated by the test refactors.
TestsSplit Jackett request, result, and capabilities assertions into helpers while preserving the test coverage.
Convert AniDB title-search checks into named cases and share the seeding and result assertions through helpers.
Extract MyAnimeList subtype assertions and OAuth exchange request checks into helpers.
Move Hasheous request and decoded-result assertions into helpers for the hash lookup test.
Move ScreenScraper request and decoded-response assertions into helpers for the game-info test.
Extract Letterboxd token and authenticated-film handlers from the client-credentials test.
Extract manifest-case assertions and supplemental checks from the upstream-spec manifest test.
Update the lintexceptions expiry failure message and add a boundary test for the self-expiry date.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Pull Request
Description
This pull request resolves the seven expired category C
cyclopexceptions (#141, entered 2026-11-12, expired 2026-11-22). It splits the nine test functions that were over the cyclomatic limit of 10 into a short table or call sequence plust.Helper()helpers, and deletes the seven entries from.golangci.yml. No dated exception is left in.golangci.ymlafter this change; #141 stays open for the 39# baseline #141entries that remain.It also moves the self-exception of
tools/go/lintexceptionsto category D, expiring 2027-03-23, somainturns green again (see the last section).What changed in the tests
t.Helper()first and carry a doc comment. Every helper is at cyclop 10 or below.t.Error,t.Errorf,t.Fatalandt.Fatalfcalls is unchanged in six files.metadata/anime/anidb:TestSearchByTitleis now a named table. The five inline query blocks became five table cases with the same queries, limits, expected lengths, AIDs and scores, checked by one helper. That is why the call count in that file drops from 110 to 98: each case still checks its length, AID and score, the "not loaded" error check stays, andTestSearchByTitleDedupis unchanged.Testfunction has a doc comment.Measured cyclomatic complexity (
golangci-lintcyclop)arr/jackett/jackett_test.goTestSearcharr/jackett/jackett_test.goTestGetCapabilitiesmetadata/anime/anidb/anidb_test.goTestSearchByTitlemetadata/anime/mal/mal_test.goTestGetAnimeSubtypesmetadata/anime/mal/mal_test.goTestExchangeCodemetadata/game/hasheous/hasheous_test.goTestLookupByHashmetadata/game/screenscraper/screenscraper_test.goTestGetGameInfometadata/tracking/letterboxd/letterboxd_test.goTestNewWithClientCredentialstools/go/upstreamspec/manifest_test.goTestReadManifestThe highest value among the new helpers is 10 (
checkSearchFirstResultandcheckCapabilitiesCoreinarr/jackett).Things a reviewer should know
make lint-exceptions-gen, which re-measured all 72 modules and found 39 findings. It only deletes lines: the 19# baseline #141entries it drops all name the nine split tests, whosegocyclo,gocognitandfunlenfindings are gone with the split.checkCapabilitiesCoreinarr/jacketttakes*jackett.Capabilities. The first draft declared a value parameter, which did not compile becauseGetCapabilitiesreturns a pointer.main, the localpraetorctl audithook refuses any commit while the seven expired entries are in.golangci.yml, and the CI joblint-exceptionsfails on any branch until the category D change below is in. Each change needs the other, so they land together as separate commits.Category D for the
tools/go/lintexceptionsself-exceptiontools/go/lintexceptionsis itself an exception to one mechanism per behavior (HISS-19). Its category C date ran out on 2026-11-22, soTestThisCheckIsItselfCurrenthas failed onmainand on every pull request since then.praetorctl audit) judges the same dated block in the local hooks, but CI runs no server-sidepraetorctl auditby adoption. This check is therefore the second barrier for the block in CI. That reason is structural, so a dated burn-down does not end it.praetorctl audit, delete this package.selfExpiryis2027-03-23; the package doc and the failure message ofTestThisCheckIsItselfCurrentsay the same.TestSelfExpiryHoldsThroughItsDaypins the boundary: the check holds on the day before and on the expiry day, and fails the day after.TestExpiredHoldsThroughTheExpiryDay), and the expired planted rule inTestCheckRefusesPlantedDefectsis still refused.Module(s) Affected
arr/...(arr/jackett, test file only)metadata/...(anime/anidb,anime/mal,game/hasheous,game/screenscraper,tracking/letterboxd, test files only)tools/go/upstreamspec(test file only),tools/go/lintexceptions(expiry constant, package doc, tests), plus the root.golangci.ymlType of Change
Checklist
go test -race -count=1 -coverper touched module; coverage: jackett 97.1%, anidb 80.2%, mal 82.8%, hasheous 71.4%, screenscraper 85.1%, letterboxd 78.5%, upstreamspec 78.6%)golangci-lint runper touched module, 0 issues)example_test.goupdated if public API changed (no public API change)go.workupdated if new module added (no new module)Summary by Sourcery
Refactor complex tests and update exception handling so lint checks pass without dated cyclop exceptions.
Bug Fixes:
Enhancements:
Tests:
Chores:
Summary by CodeRabbit