-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
137 lines (123 loc) · 4.16 KB
/
.pre-commit-config.yaml
File metadata and controls
137 lines (123 loc) · 4.16 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# See https://pre-commit.com for more information
# General excludes, files can also be excluded on a hook level
exclude: .*\.patch|scripts/tests/.*|velox/external/.*|CMake/third-party/.*
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: local
hooks:
- id: clang-tidy
name: clang-tidy
description: >-
Run clang-tidy on C/C++ files, requires 'compile_commands.json'
to be available in the repo root (e.g. symlinked) or BUILD_PATH
set to it's path e.g. _build/release.
stages:
- pre-commit
entry: ./scripts/checks/run-clang-tidy.py
args: [--commit, HEAD]
language: python
types_or: [c++, c]
additional_dependencies: [clang-tidy==18.1.8]
require_serial: true
- id: check-header-ownership
name: check-header-ownership
description: Verify every .h file is tracked by a CMakeLists.txt target.
entry: python3 scripts/checks/check-header-ownership.py velox
language: python
pass_filenames: false
files: (\.h|CMakeLists\.txt)$
- id: license-header
name: license-header
description: Add missing license headers.
entry: ./scripts/checks/license-header.py
args: [-i]
language: python
additional_dependencies: [regex]
require_serial: true
exclude: |
(?x)^(
CMake/Find(Snappy|Sodium|Thrift|double-conversion)\.cmake|
velox/docs/affiliations_map.txt|
velox/.*/bitpacking\.(cpp|h)|
velox/.*/Lemire/.*|
velox/.*/gpu/CudaMemMeter.cu|
velox/.*/coverage/data/.*|
velox/tpch/gen/dbgen/.*|
NOTICE.txt
)$
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.21.0
hooks:
- id: gersemi
name: CMake formatter
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.2
hooks:
- id: clang-format
# types_or: [c++, c, cuda, metal, objective-c]
files: \.(cpp|cc|c|h|hpp|inc|cu|cuh|clcpp|mm|metal)$
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-x, --severity=warning]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.11.0-1
hooks:
- id: shfmt
# w: write changes, s: simplify, i set indent to 2 spaces
args: [-w, -s, -i, '2']
# The following checks mostly target GitHub Actions workflows.
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.0
hooks:
- id: yamllint
args: [--format, parsable, --strict]
exclude: .*\.clang-(tidy|format)
- repo: https://github.com/google/yamlfmt
rev: v0.16.0
hooks:
- id: yamlfmt
exclude: .*\.clang-(tidy|format)
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.7.0
hooks:
- id: zizmor
- repo: https://github.com/mpalmer/action-validator
rev: 2f8be1d2066eb3687496a156d00b4f1b3ea7b028
hooks:
- id: action-validator