-
Notifications
You must be signed in to change notification settings - Fork 37
/
.pre-commit-config.yaml
108 lines (95 loc) · 2.66 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
# Copyright (c) 2020-2023 by the Zeek Project. See LICENSE for details.
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
- id: checkbashisms
name: Check for bashisms in /bin/sh scripts
entry: ./tests/Scripts/3rdparty/checkbashisms.pl
language: script
types: ["sh"]
stages: ["pre-commit"]
- id: license
name: Check for license headers
entry: ./tests/Scripts/license-header.py
language: python
stages: ["pre-commit"]
types: [text]
exclude: '^tests|NOTES|README|autogen|^(CHANGES|VERSION|scripts/ninja-build-stats|\.gitmodules|\.paths|.*\.(decl|json|rst|t2d|txt))$'
- id: autogen-docs
name: Check that generated documentation is up-to-date
entry: ./doc/scripts/autogen-docs
language: script
pass_filenames: false
stages: ["pre-commit"]
- id: stray-baselines
name: Check for stray BTest baselines
entry: ./tests/Scripts/stray_baselines.py
additional_dependencies:
- btest
language: python
pass_filenames: false
stages: ["pre-commit"]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v19.1.3'
hooks:
- id: clang-format
types_or: ["c", "c++"]
stages: ["pre-commit"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: '^tests/Baseline'
- id: end-of-file-fixer
exclude: '^tests/Baseline|^doc/autogen|^doc/_static'
- id: check-yaml
stages: ["pre-commit"]
- id: check-added-large-files
- repo: https://gitlab.com/daverona/pre-commit/cpp
rev: 0.8.0
hooks:
- id: cpplint
exclude: '3rdparty/'
args: ["--quiet"]
stages: ["pre-commit"]
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
stages: ["pre-commit"]
- id: rst-directive-colons
stages: ["pre-commit"]
- id: rst-inline-touching-normal
stages: ["pre-commit"]
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
stages: ["pre-commit"]
- id: cmake-lint
stages: ["pre-commit"]
- repo: https://github.com/crate-ci/typos
rev: v1.27.2
hooks:
- id: typos
exclude: 'tests/.*/regexp/.*|.clang-tidy'
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
exclude: 3rdparty/|doc/(autogen|.*examples)/|/Baseline/|(\.svg$)|(\.dat$)