mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
83 lines
2.6 KiB
YAML
83 lines
2.6 KiB
YAML
# To run pre-commit hooks, first install pre-commit:
|
|
# - `pip install pre-commit==${PRE_COMMIT_VERSION}`
|
|
#
|
|
# Then, run the following command to install the git hook scripts:
|
|
# - `pre-commit install`
|
|
# You can run all configured hooks against all files with:
|
|
# - `pre-commit run --all-files`
|
|
# To manually run a specific hook, use:
|
|
# - `pre-commit run <hook_id> --all-files`
|
|
# To run the hooks against only the staged files, use:
|
|
# - `pre-commit run`
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: mixed-line-ending
|
|
- id: check-merge-conflict
|
|
args: [--assume-in-merge]
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: cd481d7b0bfb5c7b3090c21846317f9a8262e891 # frozen: v22.1.0
|
|
hooks:
|
|
- id: clang-format
|
|
args: [--style=file]
|
|
"types_or": [c++, c, proto]
|
|
|
|
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
|
rev: e2c2116d86a80e72e7146a06e68b7c228afc6319 # frozen: v0.6.13
|
|
hooks:
|
|
- id: cmake-format
|
|
additional_dependencies: [PyYAML]
|
|
|
|
- repo: https://github.com/rbubley/mirrors-prettier
|
|
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
|
|
hooks:
|
|
- id: prettier
|
|
|
|
- repo: https://github.com/psf/black-pre-commit-mirror
|
|
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
|
|
hooks:
|
|
- id: black
|
|
|
|
- repo: https://github.com/streetsidesoftware/cspell-cli
|
|
rev: a42085ade523f591dca134379a595e7859986445 # frozen: v9.7.0
|
|
hooks:
|
|
- id: cspell # Spell check changed files
|
|
exclude: .config/cspell.config.yaml
|
|
- id: cspell # Spell check the commit message
|
|
name: check commit message spelling
|
|
args:
|
|
- --no-must-find-files
|
|
- --no-progress
|
|
- --no-summary
|
|
- --files
|
|
- .git/COMMIT_EDITMSG
|
|
stages: [commit-msg]
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: nix-fmt
|
|
name: Format Nix files
|
|
entry: |
|
|
bash -c '
|
|
if command -v nix &> /dev/null || [ "$GITHUB_ACTIONS" = "true" ]; then
|
|
nix --extra-experimental-features "nix-command flakes" fmt "$@"
|
|
else
|
|
echo "Skipping nix-fmt: nix not installed and not in GitHub Actions"
|
|
exit 0
|
|
fi
|
|
' --
|
|
language: system
|
|
types:
|
|
- nix
|
|
pass_filenames: true
|
|
|
|
exclude: |
|
|
(?x)^(
|
|
external/.*|
|
|
.github/scripts/levelization/results/.*\.txt
|
|
)$
|