-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
65 lines (58 loc) · 2.1 KB
/
.pre-commit-config.yaml
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
58
59
60
61
62
63
64
65
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.2
hooks:
- id: clang-format
name: clang-format
files: \.(cpp|hpp|c|h)$
- repo: local
hooks:
- id: c-lint
name: c-lint
entry: clang-tidy
language: system
files: \.(c|h|cc)$
args:
- -p
- ../../build/c_cpp_pkg_template/ # Replace 'build/' with your actual compilation database path (add set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in CMakeLists.txt)
- -extra-arg=-isystem
- -extra-arg=../../install/include # Replace 'install/include' with your actual system include path
- id: cpp-lint
name: cpp-lint
entry: clang-tidy
language: system
files: \.(cpp|hpp)$
args:
- -p
- ../../build/c_cpp_pkg_template/ # Replace 'build/' with your actual compilation database path (add set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in CMakeLists.txt)
- -extra-arg=-isystem
- -extra-arg=../../install/include # Replace 'install/include' with your actual system include path
- id: cmake-format
name: CMake Format
entry: bash -c 'find . \( -name 'CMakeLists.txt' \) -exec cmake-format --line-width 100 --tab-size
4 -i {} \;'
language: system
types: [text]
pass_filenames: false
- id: cmake-lint
name: cmake-lint
entry: bash -c 'find . -name CMakeLists.txt -exec cmake-lint {} --disabled-codes C0113 C0301 C0307
\;'
language: system
types: [text]
pass_filenames: false
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
hooks:
- id: yamlfmt
args: ['-formatter', 'max_line_length=100', '-formatter', 'indent=2', '-formatter', 'retain_line_breaks=true',
'-formatter', 'include_document_start=false']
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: [--fix]