diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06ebbc31f6..0acc3eb319 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,14 @@ repos: entry: cargo fmt -- language: rust types: [rust] + - id: clippy + name: clippy + entry: cargo clippy --workspace --all-targets --all-features + language: rust + pass_filenames: false + - id: dev-generate-all + name: dev-generate-all + entry: cargo dev generate-all + language: rust + pass_filenames: false + exclude: target diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ffc8662f3..adc5c7bb4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,6 +50,13 @@ cargo test --all # Testing... These checks will run on GitHub Actions when you open your Pull Request, but running them locally will save you time and expedite the merge process. +If you have `pre-commit` [installed](https://pre-commit.com/#installation) then you can use it to +assist with formatting and linting. The following command will run the `pre-commit` hooks: + +```shell +pre-commit run --all-files +``` + Your Pull Request will be reviewed by a maintainer, which may involve a few rounds of iteration prior to merging.