File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 2
2
- name : Install pre-commit hooks
3
3
hosts : localhost
4
4
gather_facts : false
5
+ vars :
6
+ enable_pre_commit_hooks : false
5
7
tasks :
6
- - name : Install pre-commit hooks into kayobe virtual env
7
- ansible.builtin.pip :
8
- name : pre-commit
9
- version : 3.5.0
10
- virtualenv : " {{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}"
8
+ - name : Install pre-commit hooks
9
+ block :
10
+ - name : Install pre-commit hooks into kayobe virtual env
11
+ ansible.builtin.pip :
12
+ name : pre-commit
13
+ version : 3.5.0
14
+ virtualenv : " {{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}"
11
15
12
- - name : Register pre-commit hooks with git
13
- ansible.builtin.command :
14
- cmd : " {{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/bin/pre-commit install"
15
- creates : " {{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/../../.git/hooks/pre-commit"
16
- args :
17
- chdir : " {{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}"
16
+ - name : Register pre-commit hooks with git
17
+ ansible.builtin.command :
18
+ cmd : " {{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/bin/pre-commit install"
19
+ creates : " {{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/../../.git/hooks/pre-commit"
20
+ args :
21
+ chdir : " {{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}"
22
+ when : enable_pre_commit_hooks | default(false)
You can’t perform that action at this time.
0 commit comments