-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
executable file
·62 lines (62 loc) · 1.58 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
58
59
60
61
62
repos:
#####
# Basic file cleanliness
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
#####
# Python
- repo: local
hooks:
- id: generate-md-placeholders
name: Tutorials .md placeholders
entry: ./hook_scripts/pre-commit-md-placeholder.sh
language: script
always_run: true
files: "docs/source/tutorials/.*(qmd|md)$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
hooks:
# Sort imports
- id: ruff
args: ["check", "--select", "I", "--fix"]
# Run the linter
- id: ruff
# Run the formatter
- id: ruff-format
args: ["--line-length", "79"]
- repo: https://github.com/numpy/numpydoc
rev: v1.7.0
hooks:
- id: numpydoc-validation
#####
# Quarto
- repo: local
hooks:
- id: format-qmd-python
name: Format Python in QMD
entry: python hook_scripts/quarto_python_formatter.py "-q --line-length 79"
language: python
files: \.qmd$
additional_dependencies: [ruff]
#####
# Secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
exclude: package.lock.json
####
# Typos
- repo: https://github.com/crate-ci/typos
rev: v1.20.0
hooks:
- id: typos
args: ["--force-exclude"]