-
Notifications
You must be signed in to change notification settings - Fork 84
/
.pre-commit-config.yaml
108 lines (99 loc) · 2.76 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
repos:
# Display the arguments passed to the hook
- repo: meta
hooks:
- id: identity
# For all files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict
fail_fast: true
- id: no-commit-to-branch
args: [--branch=master, --branch=develop]
fail_fast: true
- id: forbid-submodules
fail_fast: true
- id: detect-private-key
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- id: end-of-file-fixer
# Formatting for TOML
- id: check-toml
# Formatting for YAML
- id: check-yaml
# For all files
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
- id: remove-tabs
# Linting and formatting for C++
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args: [-i]
exclude: |
(?x)^(
cpp/src/hashtable.*|
cpp/src/tables.*
)$
# - id: clang-tidy
# - id: oclint
# - id: cppcheck
# - id: include-what-you-use
# args: [-Xiwyu, --no_comments]
# Formatting markdown files
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.40.0
hooks:
- id: markdownlint
args: [--fix]
- repo: local
hooks:
# Linting for Python
- id: ruff-check
name: Python - Linting with Ruff
entry: bash -c 'pip install ruff && cd python && ruff check'
language: system
types_or: [python]
pass_filenames: false
# Formatting for Python
- id: ruff-format
name: Python - Formatting with Ruff
entry: bash -c 'pip install ruff && cd python && ruff format'
language: system
types_or: [python]
pass_filenames: false
# Type checking for Python
- id: mypy
name: Python - Type checking with mypy
entry: bash -c 'pip install mypy && cd python && mypy .'
language: system
types_or: [python]
pass_filenames: false
stages:
- pre-commit
- pre-merge-commit
- pre-rebase
- manual
# Unit testing for Python
- id: unittest
name: Python - Run unit tests
entry: python -m unittest discover
language: system
pass_filenames: false
stages:
- pre-commit
- pre-merge-commit
- pre-rebase
- manual
# Display the differences between the original and formatted code
- id: git-diff
name: git diff
entry: git diff --color --exit-code
language: system
pass_filenames: false
always_run: true