Skip to content

Commit 22d5fe1

Browse files
authored
ci: Replace reviewdog with pre-commit (#319)
1 parent 46cba43 commit 22d5fe1

File tree

3 files changed

+48
-71
lines changed

3 files changed

+48
-71
lines changed

.github/workflows/pr_pre-commit.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: pre-commit
3+
4+
on:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
RUST_TOOLCHAIN_VERSION: "1.80.1"
10+
11+
jobs:
12+
pre-commit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
19+
with:
20+
python-version: '3.12'
21+
- uses: dtolnay/rust-toolchain@master
22+
with:
23+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
24+
components: rustfmt,clippy
25+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
26+
with:
27+
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"

.github/workflows/pr_reviewdog.yml

-55
This file was deleted.

.pre-commit-config.yaml

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
2-
# See https://pre-commit.com for more information
32
fail_fast: true
4-
# See https://pre-commit.com/hooks.html for more hooks
53
repos:
64
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.2.0
5+
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0
86
hooks:
97
- id: trailing-whitespace
108
# Generated file
@@ -16,36 +14,38 @@ repos:
1614
- id: detect-private-key
1715

1816
- repo: https://github.com/doublify/pre-commit-rust
19-
rev: v1.0
17+
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
2018
hooks:
2119
- id: fmt
2220
args: ["--all", "--", "--check"]
2321
- id: clippy
2422
args: ["--all-targets", "--", "-D", "warnings"]
2523

2624
- repo: https://github.com/adrienverge/yamllint
27-
rev: v1.26.3
25+
rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # 1.35.1
2826
hooks:
2927
- id: yamllint
3028

3129
- repo: https://github.com/igorshubovych/markdownlint-cli
32-
rev: v0.31.1
30+
rev: f295829140d25717bc79368d3f966fc1f67a824f # 0.41.0
3331
hooks:
3432
- id: markdownlint
3533

36-
- repo: https://github.com/PyCQA/flake8
37-
rev: 4.0.1
34+
- repo: https://github.com/koalaman/shellcheck-precommit
35+
rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # 0.10.0
3836
hooks:
39-
- id: flake8
37+
- id: shellcheck
38+
args: ["--severity=info"]
4039

41-
- repo: https://github.com/pre-commit/mirrors-prettier
42-
rev: v2.7.1
40+
- repo: https://github.com/rhysd/actionlint
41+
rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1
4342
hooks:
44-
- id: prettier
45-
files: ^web/
46-
additional_dependencies:
47-
# This should match prettier devDependency in web/package.json
48-
43+
- id: actionlint
44+
45+
- repo: https://github.com/hadolint/hadolint
46+
rev: b3555ba9c2bfd9401e79f2f0da68dd1ae38e10c7 # 2.12.0
47+
hooks:
48+
- id: hadolint
4949

5050
- repo: local
5151
hooks:
@@ -56,34 +56,39 @@ repos:
5656
entry: cargo xtask gen-man
5757
stages: [commit, merge-commit, manual]
5858
pass_filenames: false
59+
5960
- id: gen-comp
6061
name: gen-comp
6162
files: ^rust/stackablectl/
6263
language: system
6364
entry: cargo xtask gen-comp
6465
stages: [commit, merge-commit, manual]
6566
pass_filenames: false
67+
6668
- id: gen-openapi
6769
name: gen-openapi
6870
files: ^web/
6971
language: system
7072
entry: cargo xtask gen-openapi
7173
stages: [commit, merge-commit, manual]
7274
pass_filenames: false
75+
7376
- id: gen-ctl-readme
7477
name: gen-ctl-readme
7578
files: ^rust/stackablectl/
7679
language: system
7780
entry: cargo xtask gen-ctl-readme
7881
stages: [commit, merge-commit, manual]
7982
pass_filenames: false
83+
8084
- id: gen-docs
8185
name: gen-docs
8286
files: ^rust/stackablectl/
8387
language: system
8488
entry: cargo xtask gen-docs
8589
stages: [commit, merge-commit, manual]
8690
pass_filenames: false
91+
8792
- id: gen-cargo-nix
8893
name: gen-cargo-nix
8994
files: ^Cargo\.lock|go\.mod$

0 commit comments

Comments
 (0)