Files
firezone/.github/pre-commit-config.yaml
Jamil 6476109b73 fix(apple): Simplify Xcode rust build steps (#7709)
Xcode doesn't allow wildcards in input file lists, so the rules I set up
in #7488 never took effect.

Upon further investigation, it appears that the `strip` command executed
unconditionally at the end of every Rust build was the culprit. Since
Xcode already does this for us, it's a useless step that adds about 30s
to the build time.

Unfortunately there isn't a good way to tell Xcode not to build rust.
But now we don't need to -- `cargo`'s build cache is smart enough to
skip builds and we are back to the ~1-2s range for repeated builds when
only Swift code has changed.

We also add the swift bridge generated code to version control. These
doesn't change regularly, and Xcode sometimes complains that the files
don't exist _before_ it lets you run the `cargo build` to generate them
🙃 .
2025-01-09 07:54:37 +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 ls-files -z | 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: v1.0.9
hooks:
- id: cargo-sort
args: ["--check", "--workspace", "rust/"]