-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
68 lines (59 loc) · 1.67 KB
/
.pre-commit-config.yaml
File metadata and controls
68 lines (59 loc) · 1.67 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
repos:
# Pre-commit hooks for basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# File formatting and basic checks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
# Syntax validation
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-ast
# Python code quality
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
# File system checks
- id: check-merge-conflict
- id: check-added-large-files
- id: check-case-conflict
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
# Security checks
- id: detect-private-key
# Test naming convention
- id: name-tests-test
# Ruff for linting and formatting (replacing black, isort, flake8, etc.)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.11
hooks:
# Run the linter.
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
# Python security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
# Run tests before push (pre-push hook)
- repo: local
hooks:
- id: pytest
name: Run pytest
entry: uv run poe test
language: system
stages: [pre-push]
pass_filenames: false
always_run: true
# Configuration
default_stages: [pre-commit]
fail_fast: false