-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
92 lines (84 loc) · 2.16 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
92 lines (84 loc) · 2.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
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
repos:
# Ruff - Fast Python linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix] # Use full ruff configuration, same as CI
- id: ruff-format
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
exclude: ^docker/
- id: detect-private-key
- id: forbid-new-submodules
- id: check-json
- id: pretty-format-json
args: [--autofix, --indent=2]
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-toml
- id: check-docstring-first
- id: debug-statements
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
args: [--pytest-test-first]
exclude: ^tests/settings\.py$
# Security checks
- repo: https://github.com/pycqa/bandit
rev: 1.7.10
hooks:
- id: bandit
args: [-ll, -x, tests/]
files: ^django_postgres_anon/
# Dockerfile linting (disabled for now)
# - repo: https://github.com/hadolint/hadolint
# rev: v2.12.0
# hooks:
# - id: hadolint-docker
# files: Dockerfile$
# args: [--ignore=DL3042,--ignore=DL3059,--ignore=DL3007]
# YAML linting
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [-d, relaxed]
exclude: ^docker/
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: [--fix, --config=.markdownlint.yaml]
# Configuration
default_language_version:
python: python3.10
exclude: |
(?x)^(
.*\.egg-info/|
\.eggs/|
\.git/|
\.tox/|
build/|
dist/|
venv/|
__pycache__/|
\.pytest_cache/|
\.coverage|
htmlcov/|
docs/_build/|
example_project/static/|
example_project/media/
)
ci:
autofix_prs: true
autofix_commit_msg: "[pre-commit.ci] auto fixes from hooks"
autoupdate_schedule: monthly