Speed up dotnet format lint hook from ~85s to ~13s#3420
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches✨ Simplify code
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. Comment |
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>
f24a90a to
ee8ce34
Compare
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:
CI's lint step continues to call `dotnet run --project build -c release -- lint` (no files), so it still runs the thorough check.