-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
41 lines (33 loc) · 1.16 KB
/
.pre-commit-config.yaml
File metadata and controls
41 lines (33 loc) · 1.16 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
# Requirements:
### MacOS: `brew install pre-commit`
### Linux: `pip3 install pre-commit`
# NOTE: The first run will take some time as it will download all the hooks.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevent committing to main directly
- id: no-commit-to-branch
args: ['--branch', 'main']
# Catch merge conflict markers
- id: check-merge-conflict
# Validate file formats
- id: check-yaml
args: ['--allow-multiple-documents']
- id: check-json
- id: check-toml
# Detect private keys
- id: detect-private-key
# Clean up whitespace issues
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
# Detect filesystem and executable issues
- id: check-case-conflict # Case-insensitive filesystem issues
- id: check-executables-have-shebangs # Ensure executables have a valid shebang
# For allowing secrets to be committed, add this comment: # gitleaks:allow
- repo: https://github.com/gitleaks/gitleaks
rev: v8.21.2
hooks:
- id: gitleaks