Skip to content

perf: run deadcode in parallel with golangci-lint#23

Merged
ben-miru merged 6 commits into
mainfrom
perf/parallel-deadcode
Apr 14, 2026
Merged

perf: run deadcode in parallel with golangci-lint#23
ben-miru merged 6 commits into
mainfrom
perf/parallel-deadcode

Conversation

@ben-miru

Copy link
Copy Markdown
Contributor

Summary

  • Run deadcode concurrently with golangci-lint when both are enabled, saving ~45s in CI
  • Buffer deadcode output to avoid interleaving with golangci-lint's streaming output
  • Fall back to sequential execution when only one is enabled (no behavior change)

Test plan

  • Existing tests pass
  • New TestRunLint_ParallelGolangciAndDeadcode verifies both timings appear in output
  • Verify in a downstream repo that miru lint produces correct output with parallel execution

🤖 Generated with Claude Code

ben-miru and others added 6 commits April 14, 2026 10:41
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When both golangci-lint and deadcode are enabled, launch them
concurrently. Deadcode output is buffered and printed after both
complete to avoid interleaving. Saves ~45s in CI since deadcode
finishes within golangci-lint's runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the parallel golangci-lint/deadcode logic into runAnalyzers
and runAnalyzersParallel to keep runLintSteps under the 50-line
function length limit. Also fix gofumpt formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The exhaustruct linter requires all struct fields to be explicitly
initialized. The golangci-lint result was missing the outBuf field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ben-miru ben-miru force-pushed the perf/parallel-deadcode branch from c08aba7 to 1a690d7 Compare April 14, 2026 19:02
@ben-miru ben-miru merged commit 058b3dd into main Apr 14, 2026
2 checks passed
@ben-miru ben-miru deleted the perf/parallel-deadcode branch April 14, 2026 19:04
ben-miru added a commit that referenced this pull request Apr 14, 2026
## Summary

- Add `scripts/lint-surface.sh` and `scripts/install-lint-tools.sh` to
run and install yamllint, shellcheck, and actionlint — matching what was
added to the core repository
- Add `.yamllint.yml` and `.github/actionlint.yml` config files;
yamllint ignores the `.agents/` subtree
- Add a `surface-lint` CI job to `.github/workflows/ci.yml` using
SHA-pinned Actions for all three linters
- Declare `ubuntu-latest-m` self-hosted runner label in actionlint
config so the existing `lint` and `test` jobs don't trigger
unknown-label errors

## Changes since rebase

Rebased onto latest `main` (through #23) and added a fix commit to
declare the `ubuntu-latest-m` runner label in `.github/actionlint.yml` —
without this, actionlint would fail on the existing CI jobs that use
that runner.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Benjamin Smidt <ben@miruml.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant