Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.claude/ @DataDog/apm-common-components-core
.clang-format @DataDog/libdatadog
.pre-commit-config.yaml @DataDog/libdatadog-core
.codecov.yml @DataDog/apm-common-components-core
.cargo/* @DataDog/libdatadog-core
.config/nextest.toml @DataDog/apm-common-components-core
Expand Down
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
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
Comment thread
pawelchcki marked this conversation as resolved.
files: (Cargo\.toml|Cargo\.lock|license-tool\.toml|LICENSE-3rdparty\.csv)$
pass_filenames: false
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ If you'd like CI to automatically format your code and commit the changes to you
label to your pull request. This will trigger a one-time formatting commit if any changes are needed. If you push
additional commits after labeling, remove and re-add the label to re-run formatting.

Optionally, you can install [pre-commit](https://pre-commit.com/) hooks to run formatting and clippy checks locally
before they hit CI. See `.pre-commit-config.yaml` for setup instructions.

## Commit Message Guidelines

This project uses [Conventional Commits](https://www.conventionalcommits.org/) for commit messages and pull request titles.
Expand Down
Loading