WIP: Add a pre-commit hook and a checker to the ci
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
This commit is contained in:
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- repo: https://github.com/codespell-project/codespell
|
||||||
|
rev: v2.4.1
|
||||||
|
hooks:
|
||||||
|
- id: codespell
|
||||||
@@ -1,16 +1,13 @@
|
|||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
clippy:
|
- name: Clippy linter
|
||||||
image: rust:1.91.1-bullseye
|
image: rust:1.91.1-bullseye
|
||||||
commands:
|
commands:
|
||||||
- rustup component add clippy
|
- rustup component add clippy
|
||||||
- cargo clippy
|
- cargo clippy
|
||||||
|
- name: Unit tests
|
||||||
test:
|
|
||||||
image: rust:1.91.1-bullseye
|
image: rust:1.91.1-bullseye
|
||||||
commands:
|
commands:
|
||||||
- cargo test
|
- cargo test
|
||||||
|
|
||||||
8
.woodpecker/pre_commit_test.yaml
Normal file
8
.woodpecker/pre_commit_test.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
steps:
|
||||||
|
- name: Pre commit validation
|
||||||
|
image: codeberg.org/sp1thas/woodpecker-ci-pre-commit-runner
|
||||||
|
settings:
|
||||||
|
args: "--all-files"
|
||||||
Reference in New Issue
Block a user