-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
104 lines (96 loc) 路 3.45 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
---
# IF ERROR ON INSTALL:
# brew uninstall pre-commit
# install with non-admin install this works on mac
# curl https://pre-commit.com/install-local.py | python -
# Setup: pre-commit install
# Upgrade: pre-commit autoupdate
# Run: pre-commit run --all-files
# https://pre-commit.com/hooks.html
default_language_version:
# force all unspecified python hooks to run python3
python: python3
exclude: (.terraform.lock.hcl)|(.devcontainer/)|(.cache/)|(.vscode/)
repos:
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
# https://github.com/jumanjihouse/pre-commit-hook-yamlfmt#override-defaults
# https://yaml.readthedocs.io/en/latest/example.html
rev: 0.1.0 # or specific tag
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2']
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.3 # or higher tag
hooks:
- id: yamllint
args: [--format, parsable, --strict]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 # Use the ref you want to point at
# Documentation on the arguments for these hooks https://github.com/pre-commit/pre-commit-hooks
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-byte-order-marker
- id: check-case-conflict
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: mixed-line-ending
args: [--fix=lf]
- id: pretty-format-json
exclude: ^.vscode/
args: [--autofix, --no-ensure-ascii]
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: check-added-large-files
- id: check-merge-conflict
- id: forbid-new-submodules
- id: name-tests-test
- id: sort-simple-yaml
# - id: no-commit-to-branch
# args: [--branch, develop, --branch, master, --branch, main]
- id: requirements-txt-fixer
- id: check-toml
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
# stages: ['commit']
# https://pre-commit.com/#supported-languages
- repo: local
hooks:
- id: shellcheck
name: shellcheck
entry: zsh -c docker run --rm -v "${PWD}:/mnt" koalaman/shellcheck:stable --format=json
language: system
# FIRST TIME SETUP: GO111MODULE=on go get github.com/zricethezav/gitleaks/v4@latest
# - id: local-run
# name: Scan for secrets
# entry: gitleaks --pretty -v
# language: system
# - id: gitleaks
# name: gitleaks-scan
# entry: zsh -c docker run -v ${PWD}:/repo zricethezav/gitleaks:latest --path="/repo" --pretty -v
# language: system
# - id: markdownlint
# name: markdownlint-autofix
# entry: zsh -c docker run -i --rm -v ${PWD}:/work tmknom/markdownlint:latest --fix --config ./settings/.markdownlint.yaml content/docs
# language: system
- repo: https://github.com/tchoedak/pre-commit-sql-format
rev: v0.0.3
hooks:
- id: format-sql
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.4.0
hooks:
- id: markdownlint-cli2
types: [markdown]
- repo: local
hooks:
- id: gitleaks
name: gitleaks
entry: gitleaks --commit=latest --no-git --format json --path=. --report=.artifacts/gitleaks.json --quiet
language: system
pass_filenames: false
stages: [push]