-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
52 lines (49 loc) · 1.36 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
52 lines (49 loc) · 1.36 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
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-added-large-files
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: check-yaml
files: \.ya?ml$
- id: check-json
files: \.json5?$
- id: check-xml
files: \.xml$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.21
hooks:
- id: ruff
- id: ruff-format
# Scan for secrets
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
- id: gitleaks
name: Detect hardcoded secrets
description: Detect hardcoded secrets using Gitleaks
# fail if a commit includes a file named '.env'
# BAD:
# .env
# foo/.env
#
# Good:
# sample.env
# env.sample
# share/examples/sample.env
- repo: local
hooks:
- id: no-dotenv-files
name: ".env are not allowed."
entry: "Files may not be named .env, .env.local, .env.development, etc."
language: fail
files: "^(.*[/])?[.]env([.](local|production|development)){0,2}$"