-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
57 lines (50 loc) · 1.63 KB
/
.pre-commit-config.yaml
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
# Pre-commit configuration file
# Documentation: https://pre-commit.com/
repos:
# Keep pre-commit itself up to date
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.6.0post1
hooks:
- id: pre-commit-update
args: ["--verbose"]
# Ruff for linting Python files
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.8.3
hooks:
- id: ruff
args: ["--fix"]
# nbQA to run Ruff on Jupyter Notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.1
hooks:
- id: nbqa-ruff
name: nbQA-Ruff
args: ["--fix"]
additional_dependencies: ["ruff"]
# Format and sort TOML files
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
hooks:
- id: toml-sort
args: ["--in-place"]
# Sort imports in Python files (if separate from Ruff)
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
# Pyupgrade for updating Python syntax to newer versions
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py311-plus"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml # Validate YAML files
- id: check-json # Validate JSON files
- id: end-of-file-fixer # Ensure files end with a newline
- id: trailing-whitespace # Remove trailing whitespace
- id: check-merge-conflict # Prevent committing merge conflict markers
- id: check-added-large-files # Warn about large files being added