-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
40 lines (36 loc) · 1.29 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
40 lines (36 loc) · 1.29 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
# Pre-commit hooks — run automatically on `git commit`.
# Install once per clone: uv run pre-commit install
# Run manually on all files: uv run pre-commit run --all-files
#
# Hooks are pinned by rev for reproducibility. Bump with:
# uv run pre-commit autoupdate
repos:
# General hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=500"]
# Ruff — formatter + linter (replaces black, flake8, isort).
# Order matters: format first, then lint so the linter sees formatted code.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
hooks:
- id: ruff-format
- id: ruff
args: ["--fix"]
# Bandit static security scan. Source-only, no network — safe to run on commit.
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ["-c", "pyproject.toml", "--severity-level", "medium"]
additional_dependencies: ["bandit[toml]"]
files: ^jwt_toolkit/
# Mypy and pip-audit run in CI rather than pre-commit:
# mypy is slow on cold cache, pip-audit needs network.