generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
155 lines (149 loc) · 5.26 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
## Automatic checks (should run within seconds on the whole repository)
- repo: local
hooks:
- id: lint-skips
name: Exceptions to ansible-lint are not made via skip_ansible_lint
# Use specific "# noqa [rule name] - [description]" comments instead to silence linter errors
alias: lint-skips
entry: skip_ansible_lint
language: pygrep
types: [yaml]
exclude: ^\.pre-commit-config\.yaml$
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
# Treat warnings as errors, or pre-commit will hide them
args: [--strict]
name: All yaml files pass the yamllint linter
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
name: All shell files pass the shellcheck linter
## Manual checks (these are not fast or specific enough to be run on every commit)
- repo: https://github.com/ansible/ansible-lint
rev: v24.2.1
hooks:
- id: ansible-lint
name: Lint the repository with ansible-lint
# Only run against ansible-core so missing dependencies are discovered
additional_dependencies:
- .[core]
stages: [manual]
- repo: local
hooks:
- id: molecule-apt-repo-docker
name: The apt_repo_docker role is passing molecule tests
entry: bash -c "cd roles/apt_repo_docker/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true # It is surprisingly hard to check if a change affects a certain role
pass_filenames: false # molecule test is hardcoded above
stages: [manual]
- id: molecule-apt-repo-helm
name: The apt_repo_helm role is passing molecule tests
entry: bash -c "cd roles/apt_repo_helm/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-apt-repo-kubernetes
name: The apt_repo_kubernetes role is passing molecule tests
entry: bash -c "cd roles/apt_repo_kubernetes/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-apt-repo-ubuntu-nginx
name: The apt_repo_kubernetes role is passing molecule tests
entry: bash -c "cd roles/apt_repo_ubuntu_nginx/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-base
name: The base role is passing molecule tests
entry: bash -c "cd roles/base/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-kubeadm-base
name: The kubeadm_base role is passing molecule tests
entry: bash -c "cd roles/kubeadm_base/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-kubeadm-controlplane
name: The kubeadm_controlplane role is passing molecule tests
entry: bash -c "cd roles/kubeadm_controlplane/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-kubeadm-node
name: The kubeadm_node role is passing molecule tests
entry: bash -c "cd roles/kubeadm_node/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-kubernetes-base
name: The kubernetes_base role is passing molecule tests
entry: bash -c "cd roles/kubernetes_base/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-nginx-base
name: The upgrade_host role is passing molecule tests
entry: bash -c "cd roles/nginx_base/ && molecule test --all"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]
- id: molecule-upgrade-host
name: The upgrade_host role is passing molecule tests
entry: bash -c "cd roles/upgrade_host/ && molecule test"
language: python
additional_dependencies:
- molecule==6.0.3
- hcloud
always_run: true
pass_filenames: false
stages: [manual]