-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
99 lines (93 loc) · 2.98 KB
/
.pre-commit-config.yaml
File metadata and controls
99 lines (93 loc) · 2.98 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
# Copyright (c) ByteDance Ltd. and/or 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.
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.6'
hooks:
- id: clang-format
name: Format C++ files
types_or: [c++, c]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.25.1
hooks:
- id: gersemi
name: Format CMake files
args: ["--no-warn-about-unknown-commands"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
name: Remove trailing whitespace
args: [--markdown-linebreak-ext=md]
exclude: \.(patch|diff)$
- id: end-of-file-fixer
name: Fix end of file
- id: check-yaml
name: Check YAML files
- id: mixed-line-ending
name: Check mixed line ending
args: [--fix=lf]
- id: check-toml
name: Check TOML files
- id: check-yaml
name: Check YAML files
- id: check-xml
name: Check XML files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.11
hooks:
- id: ruff-check
name: Check Python files
types_or: [ python, pyi ]
args: [ --fix ]
- id: ruff-format
name: Format Python files
types_or: [ python, pyi ]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
- id: shfmt
name: Format shell scripts
args: ["-w", "-i", "2", "-bn", "-ci", "-sr"]
- repo: local
hooks:
- id: license-header-check
name: Check for license headers
entry: go run -C .github/license_check check_license.go
language: golang
pass_filenames: true
- id: clang-tidy
name: Lint C++ files
description: >-
Run clang-tidy on only changed lines so existing warnings don't block.
Locally it checks staged diffs; in GitHub Actions it diffs against the
PR base / merge queue base
stages: [pre-commit]
entry: ./scripts/run-clang-tidy.py
args: [--diff, auto]
language: python
pass_filenames: false
always_run: true
additional_dependencies: [clang-tidy==18.1.8]
require_serial: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: Spell Check
args: ["-L", ".codespellrc"]