diff options
author | BlackDex <[email protected]> | 2021-06-27 19:07:59 +0200 |
---|---|---|
committer | BlackDex <[email protected]> | 2021-06-27 19:11:22 +0200 |
commit | ff8e88a5dff787d3095f29ac5125e9c96a66bbef (patch) | |
tree | 3e0f20da3b9ac16c603f5dfb78f247fe8f07e086 /.pre-commit-config.yaml | |
parent | 72e1946ce5c3e6c33024be499b6e0e516a35ce92 (diff) | |
download | vaultwarden-ff8e88a5dff787d3095f29ac5125e9c96a66bbef.tar.gz vaultwarden-ff8e88a5dff787d3095f29ac5125e9c96a66bbef.zip |
Adding pre-commit config
There is a nice tool called pre-commit: https://pre-commit.com/
It can run actions prior to a commit to validate everything is working.
People can choose to enable this for them selfs, but it would be nice to have a base config by default.
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r-- | .pre-commit-config.yaml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..f9dfcbf4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,37 @@ +--- +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: check-yaml + - id: check-json + - id: check-toml + - id: end-of-file-fixer + - id: check-case-conflict + - id: check-merge-conflict + - id: detect-private-key +- repo: local + hooks: + - id: fmt + name: fmt + description: Format files with cargo fmt. + entry: cargo fmt + language: system + types: [rust] + args: ["--", "--check"] + - id: cargo-test + name: cargo test + description: Test the package for errors. + entry: cargo test + language: system + args: ["--features", "sqlite,mysql,postgresql", "--"] + types: [rust] + pass_filenames: false + - id: cargo-clippy + name: cargo clippy + description: Lint Rust sources + entry: cargo clippy + language: system + args: ["--features", "sqlite,mysql,postgresql", "--", "-D", "warnings"] + types: [rust] + pass_filenames: false |