Skip to content

Speed up dotnet format lint hook from ~85s to ~13s#3420

Open
Mpdreamz wants to merge 1 commit into
mainfrom
perf/faster-dotnet-format-lint
Open

Speed up dotnet format lint hook from ~85s to ~13s#3420
Mpdreamz wants to merge 1 commit into
mainfrom
perf/faster-dotnet-format-lint

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

@Mpdreamz Mpdreamz commented Jun 1, 2026

Why

The pre-push git hook calls `./build.sh lint `, which runs `dotnet format --verify-no-changes` on the full solution. This takes ~85s because Roslyn loads all 40+ projects and runs three formatters sequentially — `style` and `analyzers` together add ~60s of semantic analysis overhead that isn't needed locally.

What

The `lint` build target now differentiates based on whether files are provided:

  • With files (pre-push hook): runs `dotnet format whitespace --verify-no-changes --no-restore --include ` (~13s). Enforces all `.editorconfig` spacing/indentation rules; style and analyzer violations aren't accidentally introduced during normal coding.
  • No files (CI): runs `dotnet format --verify-no-changes --no-restore` (~52s). Full check — whitespace + style + analyzers — but skips restore since packages are already available, saving ~30s vs before.

CI's lint step continues to call `dotnet run --project build -c release -- lint` (no files), so it still runs the thorough check.

@Mpdreamz Mpdreamz requested a review from a team as a code owner June 1, 2026 09:00
@Mpdreamz Mpdreamz requested a review from cotti June 1, 2026 09:00
@Mpdreamz Mpdreamz added the automation packaging, ci/cd. label Jun 1, 2026
@Mpdreamz Mpdreamz temporarily deployed to integration-tests June 1, 2026 09:00 — with GitHub Actions Inactive
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@Mpdreamz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 39 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 289ac4ed-9c9a-4dc6-aec3-820f1ce96dae

📥 Commits

Reviewing files that changed from the base of the PR and between b38a552 and ee8ce34.

📒 Files selected for processing (1)
  • build/Targets.fs
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch perf/faster-dotnet-format-lint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Switch the lint target to dotnet format whitespace --no-restore, which
enforces all .editorconfig spacing/indentation rules without the Roslyn
semantic analysis passes (style + analyzers) that add ~60s. CI now calls
dotnet format --verify-no-changes --no-restore directly so style and
analyzer coverage is preserved there.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation packaging, ci/cd.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants