-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
116 lines (112 loc) · 3.3 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
109
110
111
112
113
114
115
116
---
# List of all hooks: https://pre-commit.com/hooks.html
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-json
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
# exclude: (\.dat)|(\.vcxproj(\.filters)?)|(\.targets)$
- id: fix-byte-order-marker
- id: mixed-line-ending
# - id: no-commit-to-branch
# args: [--branch, master]
- id: trailing-whitespace
- repo: https://github.com/syntaqx/git-hooks
rev: v0.0.18
hooks:
- id: forbid-binary
exclude: ^data/audio/.*\.mp3$
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: text-unicode-replacement-char
- repo: https://github.com/sirwart/ripsecrets # Secrets scanner
rev: v0.1.8
hooks:
- id: ripsecrets
exclude: \.secrets\.baseline
# uncomment to check additional patterns
# args:
# - --additional-pattern 'mytoken*'
# - --additional-pattern 'mykey*'
- repo: https://github.com/codespell-project/codespell # Common misspellings
rev: v2.3.0
hooks:
- id: codespell
files: \.(md|rst|adoc)$
args: [-L, thirdparty]
- id: codespell
files: \.(md|rst|adoc)$
args: [-L, thirdparty, --write-changes]
- repo: https://github.com/crate-ci/typos
rev: v1.28.4
hooks:
- id: typos
verbose: true
files: \.(md|rst|adoc)$
args: [--verbose]
- id: typos
verbose: true
files: \.(md|rst|adoc)$
args: [--write-changes]
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
# Disable bandit for now, as it fails on ./src/cpp-code-format.py:142:20.
- repo: https://github.com/PyCQA/bandit # Linter for security issues
rev: 1.8.0
hooks:
- id: bandit
args:
- --skip
- B101
- --severity-level
- high
- --confidence-level
- medium
# YAML
- repo: https://github.com/lyz-code/yamlfix # Formatter
rev: 1.17.0
hooks:
- id: yamlfix
- repo: https://github.com/adrienverge/yamllint # Linter
rev: v1.35.1
hooks:
- id: yamllint
# BASH
- repo: https://github.com/adamryczkowski/beautysh # Formatter
rev: v6.2.3
hooks:
- id: beautysh
args: [--indent-size=4, --tab, --force-function-style=fnpar]
- repo: https://github.com/detailyang/pre-commit-shell # Linter. Requires shellcheck
rev: 1.0.5
hooks:
- id: shell-lint
# .gitignore
- repo: https://github.com/lorenzwalthert/gitignore-tidy # Formatter
rev: 0.1.2
hooks:
- id: tidy-gitignore
args: [--allow-leading-whitespace]
exclude: ^\.gitignore$ # Ignoring the main .gitignore file for now.
# Without comments this will re-shuffle the order of all the entries.