From 59478e0dbec77bf1906b51e74d789a78fb651e0a Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sun, 29 Dec 2024 02:46:12 +0100 Subject: [PATCH] chore(ci): replace running `pre-commit` with just a formatting check Contrary to what I naively thought, `pre-commit` in CI does not result in commit messages being checked. Another action `pre-commit` was doing was running `cargo check`, but this is essentially the same as building without compilation, and we are testing by building in other CI-workflows. So we are left with only a formatting check, which does not need installing and running `pre-commit`. --- .woodpecker/check_formatting.yaml | 11 +++++++++++ .woodpecker/pre-commit.yaml | 14 -------------- 2 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 .woodpecker/check_formatting.yaml delete mode 100644 .woodpecker/pre-commit.yaml diff --git a/.woodpecker/check_formatting.yaml b/.woodpecker/check_formatting.yaml new file mode 100644 index 0000000..e536518 --- /dev/null +++ b/.woodpecker/check_formatting.yaml @@ -0,0 +1,11 @@ +steps: + check_formatting: + image: rust + environment: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + commands: + - rustup component add rustfmt + - cargo fmt --all -- --check + when: + event: [pull_request, push, tag] diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml deleted file mode 100644 index 7a8eab9..0000000 --- a/.woodpecker/pre-commit.yaml +++ /dev/null @@ -1,14 +0,0 @@ -steps: - pre-commit: - image: rust - environment: - RUST_BACKTRACE: 1 - CARGO_TERM_COLOR: always - commands: - - apt-get -y update > /dev/null - - apt-get -y install pre-commit > /dev/null - - rustup default stable - - rustup component add rustfmt clippy - - pre-commit run --all-files - when: - event: [pull_request, push, tag]