mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
130 lines
4.1 KiB
YAML
130 lines
4.1 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 --hook-type pre-commit --hook-type pre-push
|
|
#
|
|
# See https://pre-commit.com for more information
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
exclude: ^(docs/doxygen-awesome-theme/|conan\.lock$)
|
|
|
|
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
|
|
- id: trailing-whitespace
|
|
|
|
# Autoformat: YAML, JSON, Markdown, etc.
|
|
- repo: https://github.com/rbubley/mirrors-prettier
|
|
rev: 5ba47274f9b181bce26a5150a725577f3c336011 # frozen: v3.6.2
|
|
hooks:
|
|
- id: prettier
|
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: 192ad822316c3a22fb3d3cc8aa6eafa0b8488360 # frozen: v0.45.0
|
|
hooks:
|
|
- id: markdownlint-fix
|
|
exclude: LICENSE.md
|
|
|
|
- repo: https://github.com/hadolint/hadolint
|
|
rev: c3dc18df7a501f02a560a2cc7ba3c69a85ca01d3 # frozen: v2.13.1-beta
|
|
hooks:
|
|
- id: hadolint-docker
|
|
# hadolint-docker is a special hook that runs hadolint in a Docker container
|
|
# Docker is not installed in the environment where pre-commit is run
|
|
stages: [manual]
|
|
entry: hadolint/hadolint:v2.12.1-beta hadolint
|
|
|
|
- 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,
|
|
]
|
|
|
|
- repo: https://github.com/trufflesecurity/trufflehog
|
|
rev: a05cf0859455b5b16317ee22d809887a4043cdf0 # frozen: v3.90.2
|
|
hooks:
|
|
- id: trufflehog
|
|
entry: trufflehog git file://. --since-commit HEAD --max-depth=1 --no-verification --fail
|
|
|
|
# Running some C++ hooks before clang-format
|
|
# to ensure that the style is consistent.
|
|
- repo: local
|
|
hooks:
|
|
- id: json-in-cpp
|
|
name: Fix JSON style in C++
|
|
entry: pre-commit-hooks/json_in_cpp.py
|
|
types: [c++]
|
|
language: python
|
|
exclude: |
|
|
(?x)^(
|
|
tests/unit/etl/SubscriptionSourceTests.cpp|
|
|
tests/unit/web/ServerTests.cpp|
|
|
tests/unit/web/impl/ErrorHandlingTests.cpp|
|
|
tests/unit/web/ng/ServerTests.cpp|
|
|
tests/unit/web/ng/impl/ErrorHandlingTests.cpp
|
|
)$
|
|
|
|
- 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: 182152eb8c5ce1cf5299b956b04392c86bd8a126 # frozen: v20.1.8
|
|
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
|
|
always_run: true
|
|
stages: [pre-push]
|
|
language: script
|
|
pass_filenames: false
|