-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
136 lines (121 loc) · 3.89 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
136 lines (121 loc) · 3.89 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
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=10240]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-symlinks
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.38.0
hooks:
- id: yamllint
entry: yamllint --strict -c .hooks/linters/yamllint.yaml
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/codespell-project/codespell
rev: v2.4.3
hooks:
- id: codespell
entry: codespell -q 3 -f --skip=".git,.github,README.md,target,Cargo.lock" --ignore-words-list="astroid,braket,unstall,infinit,sems,te,hel"
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: script-must-have-extension
name: Ensure shell scripts end with .sh
types: [shell]
exclude: '\.tmpl$'
- id: shellcheck
exclude: '\.tmpl$'
- id: shfmt
exclude: '\.tmpl$'
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.49.1
hooks:
- id: markdownlint
args: ['--fix', '--config', '.hooks/linters/markdownlint.json']
- repo: https://github.com/ansible/ansible-lint
rev: v26.8.0
hooks:
- id: ansible-lint
# env -u GIT_INDEX_FILE prevents ansible-galaxy (called internally by
# ansible-lint) from inheriting the commit-time index file and
# corrupting it with stale blob references.
entry: env -u GIT_INDEX_FILE ansible-lint -v --force-color -c .hooks/ansible/ansible-lint.yaml
language: python
always_run: false
files: ^ansible/
additional_dependencies: [".[community]"]
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
pass_filenames: false
- repo: local
hooks:
- id: goad-token-sweep
name: DreadGOAD lab token sweep
entry: scripts/goad-token-sweep.sh
language: script
types: [text]
# Rust checks
- repo: local
hooks:
- id: cargo-fmt
name: Rust format check
# --check exits non-zero on diff (matches CI behavior). Plain
# `cargo fmt --all` silently rewrites files and exits 0, so a
# local commit could slip through with formatting drift that CI
# then rejects.
entry: cargo fmt --all -- --check
language: system
files: '\.rs$'
pass_filenames: false
- id: cargo-clippy
name: Rust clippy lint
entry: cargo clippy --workspace --all-targets -- -D warnings
language: system
files: '\.rs$'
pass_filenames: false
- id: cargo-check
name: Rust compile check
entry: cargo check --all-targets
language: system
files: '\.rs$'
pass_filenames: false
- id: cargo-test
name: Rust tests
entry: cargo test
language: system
files: '\.rs$'
pass_filenames: false
- id: prettier
name: Run prettier
entry: .hooks/prettier.sh
language: script
types: [json, yaml]
- id: docsible
name: Generate Ansible documentation with docsible
entry: .hooks/ansible/docsible-hook.sh
language: script
always_run: false
files: ^ansible/
pass_filenames: false
stages: [pre-commit]
- id: update-architecture-diagram
name: Update Architecture Diagram
entry: python .hooks/ansible/gen-arch-diagram.py
language: python
pass_filenames: false
always_run: false
files: ^ansible/(roles/|plugins/|playbooks/).*