From 04fda44d4b4c1822ed3b331544f56ef445ceb3ee Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sun, 6 Oct 2024 04:25:23 +0200 Subject: [PATCH] chore(pre-commit): move rustfmt hook to `.pre-commit-config.yaml` --- .githooks/pre-commit | 11 ----------- .pre-commit-config.yaml | 5 +++++ 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100755 .githooks/pre-commit create mode 100644 .pre-commit-config.yaml diff --git a/.githooks/pre-commit b/.githooks/pre-commit deleted file mode 100755 index 27236a0..0000000 --- a/.githooks/pre-commit +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -diff=$(cargo fmt -- --check) -result=$? - -if [ ${result} -ne 0 ]; then - echo "There are some code formatting issues, run `cargo fmt` first." - exit 1 -fi - -exit 0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2fda0b9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,5 @@ +repos: +- repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt