-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
99 lines (88 loc) · 3.22 KB
/
.pre-commit-config.yaml
File metadata and controls
99 lines (88 loc) · 3.22 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
# Pre-commit hooks for code quality
# Install: poetry run pre-commit install
# Run manually: poetry run pre-commit run --all-files
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: '\.md$'
- id: end-of-file-fixer
- id: check-yaml
exclude: '^(deployments/helm/|mkdocs\.yml)'
- id: check-json
exclude: '^\.vscode\.example/'
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: ['--fix=lf']
# Python formatting with Black
- repo: https://github.com/psf/black
rev: 25.9.0
hooks:
- id: black
language_version: python3.10
args: ['--line-length=88']
# Python import sorting with isort
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
hooks:
- id: isort
args: ['--profile', 'black', '--line-length', '88']
# Python linting with flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
args:
- '--max-line-length=88'
- '--extend-ignore=E203,W503'
- '--exclude=.git,__pycache__,.venv,build,dist'
# Python type checking (optional, can be commented out if not using)
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.8.0
# hooks:
# - id: mypy
# additional_dependencies: [types-all]
# JavaScript/TypeScript/CSS formatting with Prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [javascript, jsx, ts, tsx, css, scss, sass, html, json, yaml, markdown]
exclude: '^(package-lock\.json|poetry\.lock|deployments/helm/)'
args: ['--config', '.prettierrc']
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.45.0
hooks:
- id: markdownlint
args: ['--config', '.markdownlint.json', '--fix']
exclude: '^(node_modules/|\.venv/)'
# YAML linting
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
args: ['-d', '{extends: default, rules: {line-length: disable, document-start: disable, truthy: disable}}']
exclude: '^(mkdocs.yml|deployments/helm/|docker-compose.*.yml$)'
# Security check for Python dependencies
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ['-c', 'pyproject.toml', '--skip', 'B311']
additional_dependencies: ['bandit[toml]']
exclude: ^tests/
# Check for secrets/credentials
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: 'package-lock\.json|poetry\.lock'
# Configure pre-commit to run only on changed files by default
default_install_hook_types: [pre-commit]