-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
81 lines (73 loc) · 2.27 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
81 lines (73 loc) · 2.27 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
############################
# Pre-commit configuration #
############################
# Install via `pip install pre-commit`
# This is run as a precondition to commits, run manually via `pre-commit run`
# When adding new hooks, it may make sense to once run
# `pre-commit run --all-files` as by default only changed files are checked
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Run the linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
description: Fast Python linter
# Run the formatter
- id: ruff-format
description: Fast Python formatter
# Notebook formatting with nbQA + ruff
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.1
hooks:
- id: nbqa-ruff
args: [--fix, --exit-non-zero-on-fix]
- id: nbqa-pyupgrade
args: [--py310-plus]
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
description: Check yaml files for parseable syntax
- id: check-toml
description: Check toml files for parseable syntax
- id: check-added-large-files
description: Prevent large files from being committed
args: ['--maxkb=1000']
- id: check-merge-conflict
description: Check for files that contain merge conflict strings
- id: check-symlinks
description: Check for symlinks which do not point to anything
- id: trailing-whitespace
description: Trim trailing whitespaces
exclude: ^test/
- id: end-of-file-fixer
description: Fix empty lines at ends of files
exclude: ^test/
- id: detect-private-key
description: Detects the presence of private keys
- id: check-case-conflict
description: Check for files with case-insensitive name conflicts
- id: mixed-line-ending
description: Ensure consistent line endings
args: ['--fix=lf']
# Configuration
default_language_version:
python: python3.13
# Global exclusions
exclude: |
(?x)^(
\.git/|
\.tox/|
\.venv/|
venv/|
build/|
dist/|
.*\.egg-info/|
__pycache__/|
\.pytest_cache/|
\.mypy_cache/|
\.ruff_cache/|
doc/_build/
)