-
Notifications
You must be signed in to change notification settings - Fork 3
/
.pre-commit-config.yaml
80 lines (73 loc) · 2.62 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
repos:
# Detect Secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ["--exclude-lines", "SECRET_PREFIX = 'secret:'|.*secretsmanager:GetSecretValue.*|readonly GITHUB_OIDC_THUMBPRINT=*", "--exclude-secrets", ".*fake-secret.*|.*fake-password.*|.*FAKE_SECRET.*"]
stages: [commit]
# Python Linting using Ruff & Flake8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [] # [ --fix ]
stages: [push]
# - id: ruff-format
# types_or: [ python, pyi, jupyter ]
# stages: [push]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
stages: [push]
# Terrafmorm
- repo: https://github.com/terraform-docs/terraform-docs
rev: v0.18.0
hooks:
- id: terraform-docs-go
args: ["markdown", "table", "--recursive", "--recursive-include-main=false", "--output-file", "README.md", "./infra/terraform"]
files: ".tf$"
stages: [push]
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.91.0
hooks:
- id: terraform_fmt
stages: [push]
#- id: terraform_tflint TODO (@limorl): Install TFLint in docker and enable this hook
# stages: [push]
- id: terraform_validate
files: ^infra/terraform/environments/ # terraform_validate should run on the module root
args:
- --tf-init-args=-backend=false
# - --chdir=infra/terraform
stages: [push]
#- id: terraform_docs TODO (@limorl): Install TFLint in docker and enable this hook instead of terraform-docs-go
# stages: [push]
# - repo: local
# hooks:
# - id: terraform-validate-all
# name: terraform-validate-all
# entry: bash .github/scripts/terraform-validate-all.sh
# language: system
# stages: [push]
# Spell Checking
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell
language: python
types: [text]
stages: [push]
- repo: local
hooks:
- id: unit-tests
name: unit-tests
entry: poetry run pytest -m "not integration and not e2e" --durations=10 -vs
language: system
stages: [push]
pass_filenames: false