-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.pre-commit-config.yaml
106 lines (99 loc) · 2.84 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Git style
- id: check-added-large-files
- id: check-merge-conflict
- id: check-vcs-permalinks
- id: forbid-new-submodules
- id: no-commit-to-branch
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
# Common errors
- id: end-of-file-fixer
exclude: ^(Documentation/.*|.*.drawio)$
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: ^(Documentation/.*|.*.drawio)$
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^(bootstrap/.*.yaml|bootstrap/.*.yml)$
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: detect-private-key
# Cross platform
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
# Security
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
stages: [commit-msg]
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/detailyang/pre-commit-shell
rev: v1.0.6
hooks:
- id: shell-lint
# ---- Terraform ----
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.89.1
hooks:
- id: terraform_fmt
- id: terraform_validate
exclude: modules/.*/[^/]+$
- repo: https://github.com/bridgecrewio/checkov
rev: 3.2.98
hooks:
- id: checkov
name: Checkov
description: This hook runs checkov.
entry: checkov -d . --quiet --config-file .checkov.yaml
language: python
pass_filenames: false
always_run: false
files: \.tf$
exclude: \.+.terraform\/.*$
require_serial: true
# ---- Python ----
- repo: https://github.com/pycqa/flake8
rev: "6.0.0"
hooks:
- id: flake8
additional_dependencies:
- flake8-black>=0.1.1
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.12
exclude: .terragrunt-cache
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args:
- "--ignore=D100, D213, D400, D415, D212, D200, D104, D407, D413, D406, D203"
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
args:
- --profile
- black
- --filter-files
default_language_version:
python: python3.10
default_stages: [commit, push]