ci: run pre-commit as lint

This reuses the `pre-commit` tool used starting today to avoid code
duplication.
This commit is contained in:
Mikolaj Wielgus 2024-10-06 05:45:29 +02:00
parent 36628d04ae
commit a3f744cce8
1 changed files with 4 additions and 3 deletions

View File

@ -1,13 +1,14 @@
steps: steps:
lint: pre-commit:
image: rust image: rust
environment: environment:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
commands: commands:
- apt-get -y update > /dev/null
- apt-get -y install pre-commit > /dev/null
- rustup default stable - rustup default stable
- rustup component add rustfmt clippy - rustup component add rustfmt clippy
- cargo fmt --check - pre-commit run --all-files
- cargo clippy
when: when:
event: [pull_request, push, tag] event: [pull_request, push, tag]