-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
74 lines (70 loc) · 2.52 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
74 lines (70 loc) · 2.52 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
# This file configures the pre-commit hooks for the project.
# For more information, see https://pre-commit.com
default_install_hook_types: [pre-commit, pre-push]
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace # Trims trailing whitespace.
stages: [pre-commit]
- id: end-of-file-fixer # Ensures files end with a single newline.
stages: [pre-commit]
- id: check-yaml # Checks YAML files for parseable syntax.
stages: [pre-commit]
- id: check-toml # Checks TOML files for parseable syntax.
stages: [pre-commit]
- id: check-json # Checks JSON files for parseable syntax.
stages: [pre-commit]
- id: check-added-large-files # Prevents committing large files.
stages: [pre-commit]
- id: check-case-conflict # Checks for files that would conflict on case-insensitive filesystems.
stages: [pre-commit]
- id: check-merge-conflict # Checks for files that contain merge conflict strings.
stages: [pre-commit]
- id: debug-statements # Checks for leftover debugger imports and calls (e.g., pdb, breakpoint()).
stages: [pre-commit]
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
# Check for updates: https://github.com/astral-sh/ruff-pre-commit/releases
rev: v0.8.5
hooks:
# Run the linter
- id: ruff
args: [--fix]
stages: [pre-commit]
# Run the formatter (replaces Black)
- id: ruff-format
stages: [pre-commit]
# Optional: Run tests before commit
- repo: local
hooks:
- id: mypy-check
name: Mypy check
entry: uv run python -m mypy aberrant
language: system
pass_filenames: false
always_run: true
stages: [pre-commit]
- id: ruff-check-pre-push
name: Ruff check (pre-push)
entry: uv run ruff check .
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: ruff-format-check-pre-push
name: Ruff format check (pre-push)
entry: uv run ruff format --check .
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: pytest-check
name: Run tests
entry: uv run python -m pytest
language: system
pass_filenames: false
always_run: true
args: [tests/, -v, --tb=short]
stages: [pre-commit]