Skip to content

Commit

Permalink
ci: Replace reviewdog with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi committed Sep 4, 2024
1 parent 46cba43 commit 5bf4dc1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 71 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr_pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: pre-commit

on:
pull_request:

env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN_VERSION: "1.80.1"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
components: rustfmt,clippy
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"
55 changes: 0 additions & 55 deletions .github/workflows/pr_reviewdog.yml

This file was deleted.

37 changes: 21 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
# See https://pre-commit.com for more information
fail_fast: true
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0
hooks:
- id: trailing-whitespace
# Generated file
Expand All @@ -16,36 +14,38 @@ repos:
- id: detect-private-key

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
hooks:
- id: fmt
args: ["--all", "--", "--check"]
- id: clippy
args: ["--all-targets", "--", "-D", "warnings"]

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # 1.35.1
hooks:
- id: yamllint

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.31.1
rev: f295829140d25717bc79368d3f966fc1f67a824f # 0.41.0
hooks:
- id: markdownlint

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
- repo: https://github.com/koalaman/shellcheck-precommit
rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # 0.10.0
hooks:
- id: flake8
- id: shellcheck
args: ["--severity=info"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
- repo: https://github.com/rhysd/actionlint
rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1
hooks:
- id: prettier
files: ^web/
additional_dependencies:
# This should match prettier devDependency in web/package.json
- prettier@2.8.8
- id: actionlint

- repo: https://github.com/hadolint/hadolint
rev: b3555ba9c2bfd9401e79f2f0da68dd1ae38e10c7 # 2.12.0
hooks:
- id: hadolint

- repo: local
hooks:
Expand All @@ -56,34 +56,39 @@ repos:
entry: cargo xtask gen-man
stages: [commit, merge-commit, manual]
pass_filenames: false

- id: gen-comp
name: gen-comp
files: ^rust/stackablectl/
language: system
entry: cargo xtask gen-comp
stages: [commit, merge-commit, manual]
pass_filenames: false

- id: gen-openapi
name: gen-openapi
files: ^web/
language: system
entry: cargo xtask gen-openapi
stages: [commit, merge-commit, manual]
pass_filenames: false

- id: gen-ctl-readme
name: gen-ctl-readme
files: ^rust/stackablectl/
language: system
entry: cargo xtask gen-ctl-readme
stages: [commit, merge-commit, manual]
pass_filenames: false

- id: gen-docs
name: gen-docs
files: ^rust/stackablectl/
language: system
entry: cargo xtask gen-docs
stages: [commit, merge-commit, manual]
pass_filenames: false

- id: gen-cargo-nix
name: gen-cargo-nix
files: ^Cargo\.lock|go\.mod$
Expand Down

0 comments on commit 5bf4dc1

Please sign in to comment.