-
Notifications
You must be signed in to change notification settings - Fork 19
chore: add pre-commit config for local Rust lint checks #1871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+40
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
40b0216
chore: add pre-commit config for local Rust checks
pawelchcki f135292
chore: add .pre-commit-config.yaml to CODEOWNERS
pawelchcki d93673b
chore: address Copilot review comments on pre-commit config
pawelchcki 23f46b1
Merge branch 'main' into commit_hook
pawelchcki 8d6fd46
chore: pin rustfmt nightly to match CI in pre-commit config
pawelchcki 19cd971
Update CONTRIBUTING.md
pawelchcki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Pre-commit configuration for libdatadog | ||
| # | ||
| # Install (GIT_CONFIG_GLOBAL=/dev/null works around DD core.hooksPath): | ||
| # GIT_CONFIG_GLOBAL=/dev/null pre-commit install | ||
| # GIT_CONFIG_GLOBAL=/dev/null pre-commit install --hook-type pre-push | ||
| # | ||
| # Mirrors CI checks from .github/workflows/lint.yml: | ||
| # pre-commit: cargo +nightly-2026-02-08 fmt --all | ||
| # pre-push: cargo clippy --workspace --all-targets --all-features -- -D warnings | ||
| # pre-commit: dd-rust-license-tool check (on dependency/license file changes) | ||
| repos: | ||
| - repo: local | ||
| hooks: | ||
| - id: cargo-fmt | ||
| name: cargo fmt | ||
| language: system | ||
| # Pinned to match CI (.github/workflows/lint.yml). Keep this in sync. | ||
| entry: cargo +nightly-2026-02-08 fmt --all -- | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
|
||
| - id: cargo-clippy | ||
| name: cargo clippy | ||
| language: system | ||
| entry: cargo clippy --workspace --all-targets --all-features -- -D warnings | ||
| types: [rust] | ||
| pass_filenames: false | ||
| stages: [pre-push] | ||
|
|
||
| - id: license-3rdparty | ||
| name: dd-rust-license-tool check | ||
| language: system | ||
| # CI pins version 1.0.6 — install with: cargo install dd-rust-license-tool --version 1.0.6 | ||
| entry: dd-rust-license-tool check | ||
| files: (Cargo\.toml|Cargo\.lock|license-tool\.toml|LICENSE-3rdparty\.csv)$ | ||
| pass_filenames: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.