-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
104 lines (92 loc) · 2.73 KB
/
.pre-commit-config.yaml
File metadata and controls
104 lines (92 loc) · 2.73 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
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
# Pre-commit hooks for devstack-core
# See https://pre-commit.com for more information
# Install: pip install pre-commit && pre-commit install
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
args: [--fix=lf]
- id: detect-private-key
- id: no-commit-to-branch
args: [--branch, main, --branch, master]
# Shell script formatting and linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [--severity=warning]
exclude: ^(node_modules|.git)/
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-1
hooks:
- id: shfmt
args: [-w, -i, 2, -ci, -sr]
# Python linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# YAML formatting
- repo: https://github.com/google/yamlfmt
rev: v0.10.0
hooks:
- id: yamlfmt
args: [-formatter, "retain_line_breaks=true"]
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.38.0
hooks:
- id: markdownlint
args: [--fix]
# Docker Compose validation
- repo: local
hooks:
- id: docker-compose-check
name: docker-compose-check
entry: docker compose config --quiet
language: system
files: docker-compose\.yml$
pass_filenames: false
# Environment file validation
- repo: local
hooks:
- id: check-env-example
name: check-env-example
entry: bash -c 'grep -E "^[A-Z_]+=" .env.example > /dev/null || (echo ".env.example has invalid format" && exit 1)'
language: system
files: \.env\.example$
pass_filenames: false
# Secrets detection
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: [--baseline, .secrets.baseline]
exclude: package.lock.json
# Git commit message linting
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
stages: [commit-msg]
# Configuration
default_language_version:
python: python3.11
ci:
skip: [docker-compose-check]