-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
110 lines (96 loc) · 2.69 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
105
106
107
108
109
110
exclude: '^docs/|/migrations/|^devcontainer.json$|.*\.tmp$'
default_stages: [pre-commit]
default_language_version:
python: python3.12
repos:
# General hooks from pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
# - id: no-commit-to-branch
# args: [--branch, 'main']
# Linting and validation
- repo: https://github.com/hadolint/hadolint
rev: v2.13.1-beta
hooks:
- id: hadolint
args: ["--ignore=DL3008"]
- repo: https://github.com/python-openapi/openapi-spec-validator
rev: 0.7.1
hooks:
- id: openapi-spec-validator # OpenAPI Spec Validation
# Django-specific tools
- repo: https://github.com/adamchainz/django-upgrade
rev: '1.22.2'
hooks:
- id: django-upgrade
args: ['--target-version', '5.1']
# Django-specific tools
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.36.3
hooks:
- id: djlint-reformat-django
- id: djlint-django # Django template linting
# Commit message validation
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]
# Python linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format # Ruff for formatting
# Security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
args: [
'-s', 'B101,B602,B404,B603,B607', # Skip multiple checks
'-ll', # Only report high and medium severity issues
]
# Static type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
# Secret detection
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
# Local hooks
- repo: local
hooks:
- id: auto-update-hooks
name: Auto-update pre-commit hooks
entry: pre-commit autoupdate
language: system
stages: [manual]
# - repo: local
# hooks:
# - id: check-migrations
# name: Check Django migrations
# entry: ./scripts/shell/check_migrations.sh
# language: script
# stages: [pre-commit]
# pass_filenames: false
ci:
autoupdate_schedule: weekly
fail_fast: true
skip: []
submodules: false