Problem
Directory linting groups files by parent directory and invokes every package rule sequentially for each group. As a result, the default golangci-lint rule starts a separate external process for every package directory.
Relevant code:
lint/lint.go:268-309
internal/lints/default_golangci.go:42-77
For repositories with many packages, repeated process startup and repeated package loading can dominate tlin runtime.
Proposed change
Give external-tool rules a run-level execution path that can receive all requested package directories. Invoke golangci-lint run once with the collected targets, then filter and remap diagnostics using the existing package scopes.
Keep file and ordinary package rules on their current execution scopes.
Acceptance criteria
- A directory lint starts at most one
golangci-lint process per requested root, unless command-size limits require chunking.
- Diagnostics are restricted to requested files and preserve
.gno path remapping.
- Cancellation terminates the external process.
- Add an end-to-end directory benchmark or an injectable command-runner test that verifies invocation count.
Problem
Directory linting groups files by parent directory and invokes every package rule sequentially for each group. As a result, the default
golangci-lintrule starts a separate external process for every package directory.Relevant code:
lint/lint.go:268-309internal/lints/default_golangci.go:42-77For repositories with many packages, repeated process startup and repeated package loading can dominate tlin runtime.
Proposed change
Give external-tool rules a run-level execution path that can receive all requested package directories. Invoke
golangci-lint runonce with the collected targets, then filter and remap diagnostics using the existing package scopes.Keep file and ordinary package rules on their current execution scopes.
Acceptance criteria
golangci-lintprocess per requested root, unless command-size limits require chunking..gnopath remapping.