Skip to content

Commit f96d619

Browse files
committed
feat: register pre-commit with git
1 parent f0674d7 commit f96d619

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/sirwart/ripsecrets
9+
rev: v0.1.7
10+
hooks:
11+
- id: ripsecrets
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
---
22
- name: Install pre-commit hooks
33
hosts: localhost
4-
become: true
54
gather_facts: false
65
tasks:
76
- name: Install pre-commit hooks into kayobe virtual env
87
ansible.builtin.pip:
98
name: pre-commit
109
version: 3.5.0
1110
virtualenv: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}"
11+
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') }}"

0 commit comments

Comments
 (0)