-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
70 lines (65 loc) · 2.19 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
---
# Refer: https://github.com/techtales-io/terraform-minio/blob/main/.pre-commit-config.yaml
fail_fast: false
default_stages:
- commit
- push
# exclude: "^assets/"
repos:
- repo: https://github.com/ansible/ansible-lint
rev: v24.9.2
hooks:
- id: ansible-lint
args:
- --project-dir=./stage1
- --exclude=container/
# Uncomment if you need the full Ansible community bundle instead of ansible-core:
# additional_dependencies:
# - ansible
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.96.1
hooks:
- id: terraform_fmt
- id: terraform_validate
exclude: '^[^/]+$'
- id: terraform_trivy
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Prevent giant files from being committed. default=500kB
- id: check-added-large-files
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Checks that non-binary executables have a proper shebang.
- id: check-executables-have-shebangs
# Attempts to load all json files to verify syntax.
- id: check-json
# Checks for symlinks which do not point to anything.
- id: check-symlinks
# Checks for the existence of private keys.
- id: detect-private-key
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Removes UTF-8 byte order marker
- id: fix-byte-order-marker
# Replaces or checks mixed line ending.
- id: mixed-line-ending
args:
- --fix=auto
# trailing-whitespace
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
# Protect specific branches from direct checkins.
- id: no-commit-to-branch
args: ["--branch", "main"]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.20.0
hooks:
- id: gitleaks
stages: [commit]