-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
38 lines (36 loc) · 1.17 KB
/
.pre-commit-config.yaml
File metadata and controls
38 lines (36 loc) · 1.17 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
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
# # Disable for now and use clang-format-diff.py instead to only format changed lines.
# - repo: https://github.com/pocc/pre-commit-hooks
# rev: v1.3.5
# hooks:
# - id: clang-format
# name: clang-format
# types_or: [ c, c++ ]
# args:
# - -i
# stages: [ manual ]
- repo: local
hooks:
- id: clang-format-diff
name: clang-format-diff
# We pipe 'git diff' to the python script.
# -p1 strips the a/ b/ prefixes from the diff so the script finds the files.
# -i applies the edits in-place.
entry: bash -c 'git diff -U0 --no-color --cached | python3 utils/clang-format-diff.py -p1 -i'
language: system
types_or: [ c, c++ ]
pass_filenames: false