From 150791d863c64a88d66a3a0541873ffc18d2eba4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:56:23 +0000 Subject: [PATCH] ci: sync with template repository --- .github/workflows/pre-commit.yaml | 21 ++++++++++ .pre-commit-config.yaml | 64 +++++++------------------------ 2 files changed, 34 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/pre-commit.yaml diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 00000000..23cedae2 --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,21 @@ +name: pre-commit + +on: + push: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + pre-commit: + name: pre-commit + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: pre-commit + uses: liblaf/template/.github/actions/pre-commit@main + with: + autofix: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c6d0e2f..0fa03ec4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,6 @@ ci: - autofix_commit_msg: | - ci(pre-commit): auto fixes from pre-commit.com hooks - - for more information, see https://pre-commit.ci - autoupdate_commit_msg: | - ci(pre-commit): pre-commit autoupdate + autofix_commit_msg: "ci(pre-commit): auto fixes from pre-commit.com hooks" + autoupdate_commit_msg: "ci(pre-commit): pre-commit autoupdate" skip: - cargo-check - cargo-clippy @@ -13,7 +9,6 @@ ci: - latexindent - poetry-lock - shellcheck - repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.2.1 @@ -21,6 +16,7 @@ repos: - id: ruff args: - --fix + - --unsafe-fixes - id: ruff-format - repo: https://github.com/cmhughes/latexindent.pl rev: V3.23.6 @@ -47,6 +43,14 @@ repos: files: \.(bash|sh|zsh)(\.tmpl)?$ types: - text + - repo: https://github.com/liblaf/template + rev: main + hooks: + - id: cargo-check + - id: cargo-clippy + - id: cargo-fmt + - id: cargo-test + - id: prettier - repo: https://github.com/pre-commit/mirrors-clang-format rev: v17.0.6 hooks: @@ -94,13 +98,13 @@ repos: rev: 1.7.0 hooks: - id: poetry-check - - id: poetry-lock - id: poetry-export args: - --output=requirements.txt - --without-hashes - --without-urls - id: poetry-install + - id: poetry-lock - repo: https://github.com/scop/pre-commit-shfmt rev: v3.8.0-1 hooks: @@ -117,53 +121,11 @@ repos: - repo: https://github.com/sirosen/texthooks rev: 0.6.4 hooks: - # - id: fix-smartquotes + - id: alphabetize-codeowners - id: fix-ligatures - id: fix-spaces - id: forbid-bidi-controls - - id: alphabetize-codeowners - repo: https://github.com/streetsidesoftware/cspell-cli rev: v8.3.0 hooks: - id: cspell - - repo: local - hooks: - - id: cargo-check - name: cargo check - entry: cargo check - language: rust - types: - - rust - pass_filenames: false - - id: cargo-clippy - name: cargo clippy - entry: cargo clippy - language: rust - types: - - rust - pass_filenames: false - - id: cargo-fmt - name: cargo fmt - entry: cargo fmt - language: rust - types: - - rust - pass_filenames: false - - id: cargo-test - name: cargo test - entry: cargo test - language: rust - types: - - rust - pass_filenames: false - - id: prettier - name: Prettier - entry: prettier --write --ignore-unknown - language: node - types: - - text - additional_dependencies: - - prettier@latest - -default_stages: - - pre-commit