diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6d95686c86..3fd262d089 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,16 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 - - # ref: https://github.com/pre-commit/action - - uses: pre-commit/action@v3.0.1 - - name: Help message if pre-commit fail - if: ${{ failure() }} - run: | - echo "You can install pre-commit hooks to automatically run formatting" - echo "on each commit with:" - echo " pre-commit install" - echo "or you can run by hand on staged files with" - echo " pre-commit run" - echo "or after-the-fact on already committed files with" - echo " pre-commit run --all-files --hook-stage manual" + - name: "Run pre-commit" + run: + pip install -U pre-commit + pre-commit run --all-files --hook-stage manual diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92862432fd..cd78710252 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-case-conflict - id: check-executables-have-shebangs @@ -12,18 +12,10 @@ repos: #- id: trailing-whitespace #- id: check-json -- repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 - hooks: - - id: mdformat - args: ["--wrap=120", "--number"] - additional_dependencies: - [mdformat-gfm, mdformat-frontmatter, mdformat-footnote, mdformat-gfm-alerts] - # We use the Python version instead of the original version which seems to require Docker # https://github.com/koalaman/shellcheck-precommit - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.9.0.6 + rev: v0.10.0.1 hooks: - id: shellcheck name: shellcheck @@ -41,9 +33,17 @@ repos: types: [markdown] entry: bash scripts/check_anchors/check-anchors.sh language: node + +- repo: https://github.com/executablebooks/mdformat + rev: 0.7.17 + hooks: + - id: mdformat + args: ["--wrap=120", "--number"] + additional_dependencies: + [mdformat-gfm, mdformat-frontmatter, mdformat-footnote, mdformat-gfm-alerts] - repo: https://github.com/tcort/markdown-link-check - rev: v3.11.2 + rev: v3.12.2 hooks: - id: markdown-link-check args: ["-c", "markdown_link_config.json"] @@ -57,7 +57,7 @@ repos: stages: [manual] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 + rev: 0.28.4 hooks: - id: check-github-workflows @@ -69,7 +69,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/codespell-project/codespell - rev: "v2.2.6" + rev: "v2.3.0" hooks: - id: codespell args: ["-L", "fle,re-use,merchantibility,synching,crate,nin,infinit,te"]