mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
127 lines
3.8 KiB
YAML
127 lines
3.8 KiB
YAML
---
|
|
# pre-commit is a tool to perform a predefined set of tasks manually and/or
|
|
# automatically before git commits are made.
|
|
#
|
|
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
|
|
#
|
|
# Common tasks
|
|
#
|
|
# - Run on all files: pre-commit run --all-files
|
|
# - Register git hooks: pre-commit install --install-hooks
|
|
#
|
|
# See https://pre-commit.com for more information
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
repos:
|
|
# `pre-commit sample-config` default hooks
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
- id: check-executables-have-shebangs
|
|
- id: check-shebang-scripts-are-executable
|
|
- id: end-of-file-fixer
|
|
exclude: ^docs/doxygen-awesome-theme/
|
|
- id: trailing-whitespace
|
|
exclude: ^docs/doxygen-awesome-theme/
|
|
|
|
# Autoformat: YAML, JSON, Markdown, etc.
|
|
- repo: https://github.com/rbubley/mirrors-prettier
|
|
rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3
|
|
hooks:
|
|
- id: prettier
|
|
exclude: ^docs/doxygen-awesome-theme/
|
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: 586c3ea3f51230da42bab657c6a32e9e66c364f0 # frozen: v0.44.0
|
|
hooks:
|
|
- id: markdownlint-fix
|
|
exclude: LICENSE.md
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen: v2.4.1
|
|
hooks:
|
|
- id: codespell
|
|
args:
|
|
[
|
|
--write-changes,
|
|
--ignore-words=pre-commit-hooks/codespell_ignore.txt,
|
|
]
|
|
|
|
# Running fix-local-includes before clang-format
|
|
# to ensure that the include order is correct.
|
|
- repo: local
|
|
hooks:
|
|
- id: fix-local-includes
|
|
name: Fix Local Includes
|
|
entry: pre-commit-hooks/fix-local-includes.sh
|
|
types: [c++]
|
|
language: script
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: f9a52e87b6cdcb01b0a62b8611d9ba9f2dad0067 # frozen: v19.1.7
|
|
hooks:
|
|
- id: clang-format
|
|
args: [--style=file]
|
|
types: [c++]
|
|
|
|
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
|
rev: e2c2116d86a80e72e7146a06e68b7c228afc6319 # frozen: v0.6.13
|
|
hooks:
|
|
- id: cmake-format
|
|
additional_dependencies: [PyYAML]
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: check-no-h-files
|
|
name: No .h files
|
|
entry: There should be no .h files in this repository
|
|
language: fail
|
|
files: \.h$
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: gofmt
|
|
name: Go Format
|
|
entry: pre-commit-hooks/run-go-fmt.sh
|
|
types: [go]
|
|
language: golang
|
|
description: "Runs `gofmt`, requires golang"
|
|
- id: check-docs
|
|
name: Check Doxygen Documentation
|
|
entry: pre-commit-hooks/check-doxygen-docs.sh
|
|
types: [text]
|
|
language: script
|
|
pass_filenames: false
|
|
- id: verify-commits
|
|
name: Verify Commits
|
|
entry: pre-commit-hooks/verify-commits.sh
|
|
types: [text]
|
|
language: script
|
|
pass_filenames: false
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: lfs-post-checkout
|
|
name: LFS Post Checkout
|
|
entry: pre-commit-hooks/lfs/post-checkout
|
|
types: [text]
|
|
stages: [post-checkout]
|
|
language: script
|
|
- id: lfs-post-commit
|
|
name: LFS Post Commit
|
|
entry: pre-commit-hooks/lfs/post-commit
|
|
types: [text]
|
|
stages: [post-commit]
|
|
language: script
|
|
- id: lfs-post-merge
|
|
name: LFS Post Merge
|
|
entry: pre-commit-hooks/lfs/post-merge
|
|
types: [text]
|
|
stages: [post-merge]
|
|
language: script
|
|
- id: lfs-pre-push
|
|
name: LFS Pre Push
|
|
entry: pre-commit-hooks/lfs/pre-push
|
|
types: [text]
|
|
stages: [pre-push]
|
|
language: script
|