From 0b98440f54644ead73496c35e1369d78c99be067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Sun, 10 Nov 2019 18:33:27 +0100 Subject: [PATCH] nio-rust: Add a pre-commit config. --- .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..afdeace7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.2.3 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + +- repo: local + hooks: + - id: fmt + name: fmt + language: system + types: [file, rust] + entry: cargo fmt -- --check + + - id: clippy + name: clippy + language: system + types: [file, rust] + entry: cargo clippy --all-targets --all + pass_filenames: false + + - id: test + name: test + language: system + files: '\.rs$' + entry: cargo test --lib + pass_filenames: false