Files
firezone/.github/pre-commit-config.yaml
Thomas Eizinger e05c98bfca ci: update to new cargo sort release (#9354)
The latest release now also sorts workspace dependencies, as well as
different dependency sections. Keeping these things sorted reduces the
chances of merge conflicts when multiple PRs edit these files.
2025-06-02 02:01:09 +00:00

57 lines
1.9 KiB
YAML

repos:
- repo: local
hooks:
- id: codespell
name: "python: codespell"
args: [--config=.github/codespellrc]
entry: codespell
language: system
pass_filenames: false
- id: prettier-git-files
name: Prettier (only git-tracked files)
entry: bash -c 'git grep --cached -z -l '' | xargs -0 prettier --check --ignore-unknown'
language: system
pass_filenames: false
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: mixed-line-ending
args: ["--fix=lf"]
description: Forces to replace line ending by the UNIX 'lf' character.
exclude: "(^website/public/images/|^kotlin/android/gradlew.bat|^rust/windows-client/wintun/|^elixir/apps/web/priv/static/)"
- id: check-yaml
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: (^website/public/images/|^elixir/apps/web/priv/static/|^swift/apple/FirezoneNetworkExtension/Connlib/Generated/)
- id: trailing-whitespace
exclude: (^website/public/images/|^swift/apple/FirezoneNetworkExtension/Connlib/Generated/)
- id: check-merge-conflict
- id: no-commit-to-branch
args:
- -b
- master
- --pattern
- '^(?!((chore|feat|feature|bug|fix|build|ci|docs|style|refactor|perf|test|revert)\/[@a-zA-Z0-9\-\.\/]+)$).*'
# Third party pre-commit hooks
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
args: ["--severity=warning"]
exclude: ^.*/gradlew$
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
rev: v2.2.0
hooks:
- id: shell-fmt
args:
- -i
- "4"
- repo: https://github.com/DevinR528/cargo-sort
rev: v2.0.1
hooks:
- id: cargo-sort
args: ["--check", "--workspace", "rust/"]