Skip to content

Batch golangci-lint execution across package directories #196

Description

@notJoon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintAdding or updating lintL-performanceLint: performanceP-highPriority: HighT-engineType: related with engine (or internal)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions