Fix cmd/bw staticcheck failures blocking CI#127
Merged
Conversation
prime_test.go's two newer subtests still called the pre-config cmdPrime
signature, breaking the build. Update both to match the current
(*issue.Store, []string, Writer, *config.Config) (*config.Config, error)
shape used by the other call sites.
Drop five cmd/bw helpers flagged U1000 with no production callers, plus
the tests that existed solely to exercise them:
- (*Command).valueFlags (command.go) — never had a caller; commands
pass hardcoded flag lists straight to ParseArgs
- validateDate (defer.go) — replaced by resolveDateNow in
the relative-date defer fix
- toRFC3339Date (export.go) — bd-compat padding removed when
defer_until/due switched to native YYYY-MM-DD
- fromRFC3339Date (export.go) — same
- relativeTime (helpers.go) — string wrapper used only by
the pre-rewrite recap; the re-land in PR #122 calls relativeTimeSince
directly with parsed time.Time
Three real defer-behavior tests used validateDate as an incidental
date-format check; replace those with an inline time.Parse against the
YYYY-MM-DD format defer actually emits. Also drop the now-unused
"strings" import in export.go.
Keep relativeTimeSince (and its test) behind a //lint:ignore U1000
referencing PR #122, which wires it back into bw recap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI is currently red on
mainbecausecmd/bwfails thestaticcheckstep. This PR makes it green.
prime_test.go's two newer subtests stillcalled the pre-config
cmdPrimesignature. Updated both to matchthe current
(*issue.Store, []string, Writer, *config.Config) (*config.Config, error)shape used by every other call site.the tests written solely to exercise them:
(*Command).valueFlags— never had a caller; commands all passhardcoded flag lists straight to
ParseArgsvalidateDate— replaced byresolveDateNowin Fix relative date parsing in bw defer (#bw-m44) #99toRFC3339Date/fromRFC3339Date—bd-compat padding removedin Add due dates, time-granular deferrals, and query-time deferral expiry #112 when
defer_until/dueswitched to native YYYY-MM-DDrelativeTime(string wrapper) — only the pre-rewrite recapcalled it; the re-land in Add bw recap: unblocked events, recap parser, tree/JSON renderers, cross-repo fan-out #122 uses
relativeTimeSincedirectlywith parsed
time.TimevalidateDatechecks in real defer-behavior tests(
TestCmdDeferRelativeDate,…Tomorrow,…NextMonday) withtime.Parse("2006-01-02", ...)."strings"import inexport.go.relativeTimeSince(and its test) behind//lint:ignore U1000referencing Add bw recap: unblocked events, recap parser, tree/JSON renderers, cross-repo fan-out #122, which wires it back intobw recap. Once Add bw recap: unblocked events, recap parser, tree/JSON renderers, cross-repo fan-out #122 lands, that directive can be removed.Net: +8 / −184 across 9 files, all in
cmd/bw/.Test plan
go build ./...staticcheck ./...(clean)go test ./...(full suite passes)