-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
60 lines (56 loc) · 2.02 KB
/
.pre-commit-config.yaml
File metadata and controls
60 lines (56 loc) · 2.02 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
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
entry: bash -c 'affected_files=(); for f in "$@"; do grep -l "[[:space:]]$" "$f" 2>/dev/null && affected_files+=("$f"); done; if [ ${#affected_files[@]} -gt 0 ]; then trailing-whitespace-fixer "${affected_files[@]}"; exit $?; else exit 0; fi' --
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
# First execution of shellcheck reports all findings without failing
# Second execution outputs nothing and fails if any finding meets the
# defined severity.
# The outcome is all findings are reported but only ones meeting the severity
# will fail the check.
# Ignores the following rules:
# SC2071: todo(Lewis): Will fix in a follow up patch
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
verbose: true
entry: >
bash -c 'shellcheck "$@" ||
shellcheck -f quiet
--severity=error
--exclude=SC2071
"$@"' --
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
# todo(Lewis): Update version when we bump to python>=3.10
- repo: https://github.com/ansible/ansible-lint
rev: v6.22.2
hooks:
- id: ansible-lint
additional_dependencies:
- netaddr
- jmespath
# Sync test_operator README with defaults/main.yml
- repo: local
hooks:
- id: sync-test-operator-readme
name: Sync test_operator README
entry: python scripts/sync_test_operator_var_readme.py
language: python
files: ^roles/test_operator/defaults/main\.yml$
pass_filenames: false
additional_dependencies:
- PyYAML