-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
79 lines (70 loc) · 2.63 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
79 lines (70 loc) · 2.63 KB
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
# Copyright 2026 Schwarz Digits Cloud GmbH & Co. KG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# .pre-commit-config.yaml
# To use this file, install pre-commit (https://pre-commit.com):
# pip install pre-commit
# Then install the hooks in your repo:
# pre-commit install
# To run on all files manually:
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.0
hooks:
- id: terraform_fmt
args:
- --args=-recursive
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [javascript, yaml, json, markdown]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks
- repo: local
hooks:
# Requires `addlicense` to be installed locally (go install github.com/google/addlicense@latest)
- id: addlicense
name: Add License Headers
description: Ensures all files have the Apache 2.0 license header (skips files starting with #cloud-config)
entry: bash -c 'for f in "$@"; do head -n 1 "$f" | grep -q "^#cloud-config" || addlicense -c "Schwarz Digits Cloud GmbH & Co. KG" -l apache "$f"; done' --
language: system
types_or:
[terraform, python, go, javascript, yaml, json, html, css, shell]
pass_filenames: true
- id: terraform-numbered-files
name: Terraform Files Must Have Number Prefix
description: Ensures all committed .tf files in examples start with exactly 3 digits (e.g., 010-, 020-, 100-). Module files are exempt.
entry: scripts/check-terraform-numbered-files.sh
language: script
types: [terraform]
pass_filenames: true