Allow gitproto.Conn and AuthMethod through ireturn · Entire
Allow gitproto.Conn and AuthMethod through ireturn
9dc28c5→main·
nodo·1mo ago·3 files·+3 added/-3 removed
These are project-wide transport/auth interfaces, the same shape as the auth.Method entry that's already on the ireturn allowlist. Without the entries, mise run lint (which runs golangci-lint --fix) was racing: nolintlint stripped the //nolint:ireturn directives on openSource / normalizeAuth / newConn before ireturn flagged the functions, leaving lint red on every run. With the types allowed by policy, the directives become dead weight — drop them so the source documents intent once, in .golangci.yaml.
Sessions
Transcript data is unavailable for this checkpoint.
Changes
3
M.golangci.yaml+2
cmd/git-sync/internal/sha256convert
Msha256convert.go-2
internal/syncer
Msyncer.go+1/-1
97 unmodified lines
98
99
100
101
102
103
104
105
97 unmodified lines
- github.com/go-git/go-git/v6/plumbing/storer.EncodedObjectIter
- github.com/go-git/go-billy/v6.Filesystem
- entire.io/entire/git-sync/internal/auth.Method
- entire.io/entire/git-sync/internal/gitproto.Conn
- entire.io/entire/git-sync/internal/gitproto.AuthMethod
nolintlint:
require-explanation: true
require-specific: true
M.golangci.yaml+2
701 unmodified lines
702
703
704
705
705
706
707
28 unmodified lines
736
737
738
740
739
740
741
701 unmodified lines
return nil
}
//nolint:ireturn // gitproto.Conn is the shared transport interface; returning it directly mirrors the rest of git-sync.
func openSource(ctx context.Context, req Request, planCfg planner.PlanConfig) (gitproto.Conn, *gitproto.RefService, []*plumbing.Reference, error) {
ep, err := url.Parse(req.SourceURL)
if err != nil {
28 unmodified lines
return conn, svc, refs, nil
}
//nolint:ireturn // gitproto.AuthMethod is the shared signing interface; returning it lets callers pass it straight through.
func normalizeAuth(m auth.Method) gitproto.AuthMethod {
if m == nil {
return nil
Mcmd/git-sync/internal/sha256convert/sha256convert.go-2
348 unmodified lines
349 350 351 352 352 353 354 355
348 unmodified lines
// --- Session setup ---
func newConn(raw Endpoint, label string, stats *statsCollector, httpClient *http.Client) (gitproto.Conn, error) { //nolint:ireturn // transport selection intentionally returns the shared connection interface func newConn(raw Endpoint, label string, stats *statsCollector, httpClient *http.Client) (gitproto.Conn, error) { ep, err := transport.ParseURL(raw.URL) if err != nil { return nil, fmt.Errorf("parse endpoint: %w", err) }
Minternal/syncer/syncer.go+1/-1