-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
57 lines (54 loc) · 2.3 KB
/
.pre-commit-config.yaml
File metadata and controls
57 lines (54 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# =============================================================================
# Pre-commit hooks configuration for C++ / CMake project
# https://pre-commit.com
#
# Install: pre-commit install
# Run all: pre-commit run --all-files
# Update: pre-commit autoupdate
# =============================================================================
default_language_version:
python: python3
repos:
# --- General file hygiene ----------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace # Remove trailing whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer # Ensure files end with newline
- id: check-yaml # Validate YAML syntax
- id: check-json # Validate JSON syntax
- id: check-xml # Validate XML syntax
- id: check-merge-conflict # Detect merge conflict markers
- id: check-added-large-files # Prevent giant files from being committed
args: [--maxkb=1024]
- id: mixed-line-ending # Detect mixed line endings
args: [--fix=auto]
- id: check-case-conflict # Check for files that would conflict on case-insensitive FS
- id: fix-byte-order-marker # Remove UTF-8 BOM
- id: detect-private-key # Prevent committing private keys
# --- Spell checking --------------------------------------------------
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: Lint spelling in source files (with --fix)
args: [--skip, "build,_deps,*.lock,*.json", --ignore-words-list, "nd,ot,te"]
exclude: ^(build/|_deps/)
# --- Markdown lint ----------------------------------------------------
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
hooks:
- id: markdownlint
name: Lint markdown files (with --fix)
args: [--fix]
types: [markdown]
exclude: ^(build/|_deps/)
# --- YAML ------------------------------------------------------------
- repo: https://github.com/google/yamlfmt
rev: v0.21.0
hooks:
- id: yamlfmt
name: Format YAML files with yamlfmt
args: [--formatter, "indent=2,include_document_start=false,retain_line_breaks=true"]
exclude: ^(build/|_deps/|vendor/)