chore: add pre-push hook for cargo fmt and clippy#130
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a repository-managed Git pre-push hook to enforce Rust formatting and clippy checks before code is pushed, and includes a couple of small test cleanups driven by fmt/clippy.
Changes:
- Add
.githooks/pre-pushto runcargo fmt --checkandcargo clippyprior to pushing. - Simplify assertions in
dogstatsdorigin tests to satisfy clippy/fmt. - Refactor readiness polling in a trace-agent integration test using a
let-chain condition.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
crates/dogstatsd/src/origin.rs |
Minor assertion cleanup in tests (clippy/fmt-driven). |
crates/datadog-trace-agent/tests/integration_test.rs |
Simplifies server readiness polling logic in an integration test. |
.githooks/pre-push |
Introduces a pre-push hook to run cargo fmt and cargo clippy locally before pushing. |
| echo ">>> [pre-push] Running cargo clippy..." | ||
| if ! cargo clippy --all-targets --all-features -- -D warnings; then | ||
| echo "" | ||
| echo "HOOK FAILED: cargo clippy reported warnings or errors." | ||
| echo "LLM FIX: fix the clippy diagnostics above, then re-attempt the push." | ||
| exit 1 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
This PR is rejected because it was updated |
|
Think this needs #129 to stop failing unrelated tests |
Summary
.githooks/pre-pushwithcargo fmt --checkandcargo clippy -D warningsSetup
Each contributor needs to run once:
🤖 Generated with Claude Code