add clippy and rust_dev to pre-commit (#2256)

I presume the reasoning for not including clippy in `pre-commit` was that it passes all files. This can be turned off with `pass_filenames`, in which case it only runs once.

`cargo +nightly dev generate-all` is also added (when excluding `target` is does not give false positives).

(The overhead of these commands is not much when the build is there. People can always choose to run only certain hooks with `pre-commit run [hook] --all-files`)
This commit is contained in:
Simon Brugman 2023-01-28 00:53:44 +01:00 committed by GitHub
parent dd15c69181
commit 4f067d806e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -18,3 +18,14 @@ repos:
entry: cargo fmt -- entry: cargo fmt --
language: rust language: rust
types: [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

View File

@ -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 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. 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 Your Pull Request will be reviewed by a maintainer, which may involve a few rounds of iteration
prior to merging. prior to merging.