-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
50 lines (46 loc) · 1.36 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
50 lines (46 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
# Pre-commit hooks configuration
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: 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
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: [--maxkb=50000]
- id: check-merge-conflict
- id: check-case-conflict
- id: check-toml
- id: mixed-line-ending
args: [--fix=lf]
- id: detect-private-key
# Python code formatting and linting with ruff (fast, replaces black, flake8, isort)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# Python security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.9.2
hooks:
- id: bandit
args: [-ll, -i]
files: ^app/.*\.py$
exclude_dirs: ['tests']
# Ensure requirements files are valid
- repo: https://github.com/jazzband/pip-tools
rev: v7.5.2
hooks:
- id: pip-compile
name: Check requirements files are up to date
files: ^requirements.*\.(txt|in)$
pass_filenames: true
always_run: false