-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
83 lines (73 loc) · 2.57 KB
/
.pre-commit-config.yaml
File metadata and controls
83 lines (73 loc) · 2.57 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
82
83
default_stages: [commit, push]
# Fast fail - drop when first error appears
# Used with nbstripout to restart right after cleaning
# Because notebooks after cleaning are not indexed, we need to restart commit
fail_fast: true
repos:
# Use this first to fail (clean) on the first step
# and restart right after that
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
# List of all hooks: https://pre-commit.com/hooks.html
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: check-toml
- id: check-json
- id: end-of-file-fixer
exclude: LICENSE
- id: trailing-whitespace
exclude: ^exports/
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-merge-conflict
- id: check-ast
- id: check-executables-have-shebangs
- id: debug-statements
- id: check-added-large-files
args: ["--maxkb=100"]
exclude: |
(?x)^(
^exports/|
^poetry.lock
)$
- id: check-docstring-first
- id: detect-private-key
- id: check-case-conflict
- repo: local
# Use local tools to have same versions as you use in environment
# E.g. you use formatter to format during development
# and pre-commit can behave in a different way without local version
hooks:
# Run the ruff linter.
# Source: https://github.com/astral-sh/ruff-pre-commit/blob/main/.pre-commit-hooks.yaml
- id: ruff
name: ruff
entry: poetry run ruff check --force-exclude
require_serial: true
language: python
types_or: [python, pyi, jupyter]
# Run the ruff formatter.
# Source: https://github.com/astral-sh/ruff-pre-commit/blob/main/.pre-commit-hooks.yaml
- id: ruff-format
name: ruff-format
entry: poetry run ruff format --force-exclude
require_serial: true
language: python
types_or: [python, pyi, jupyter]
# Source: https://github.com/pre-commit/mirrors-mypy/blob/main/.pre-commit-hooks.yaml
- id: mypy
name: mypy
entry: poetry run mypy
types_or: [python, pyi]
require_serial: true
language: system
- id: git-commit-prefix
name: git-commit-prefix
entry: poetry run python .additional/github_commit_prefix.py
language: python
stages: [prepare-commit-msg]
description: Searches the branch name for something looking like an issue name template and prepends the commit message with it