-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (95 loc) · 2.89 KB
/
.pre-commit-config.yaml
File metadata and controls
103 lines (95 loc) · 2.89 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# pre-commit-config.yaml
# See https://pre-commit.com for docs and https://pre-commit.com/hooks.html for available hooks
# ======================================================
# ======= pre-commit configuration ========
# ======================================================
fail_fast: false
minimum_pre_commit_version: 3.0.0
default_language_version:
python: python3
default_stages:
- pre-commit
- pre-push
# ======================================================
# ======= repository hooks ========
# ======================================================
# UPDATE all the hooks regularly by running in the
# terminal:
# pre-commit autoupdate
repos:
# Fast Python linter and formatter with auto-fix support
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7
hooks:
- id: ruff-check
args: [--fix, --show-fixes]
stages: [pre-commit]
files: \.py$
- id: ruff-format
stages: [pre-commit]
files: \.py$
# Go code cleaner (removes unused exports)
#- repo: https://github.com/deeenes/unexport
# rev: 0.4.0-patch0-3
# hooks:
# - id: unexport
# args: [--refactor, --single_quotes]
# exclude: __init__.py$
# Official pre-commit-hooks for general checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Check for updates regularly
hooks:
- id: check-added-large-files
stages: [pre-commit, pre-push]
- id: check-ast
stages: [pre-commit]
- id: check-case-conflict
stages: [pre-commit]
- id: check-merge-conflict
stages: [pre-commit, pre-push]
- id: check-symlinks
stages: [pre-commit]
- id: check-yaml
args: [--unsafe]
stages: [pre-commit]
files: \.ya?ml$
- id: detect-private-key
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: mixed-line-ending
args: [--fix=lf]
exclude: ^docs/make.bat$
stages: [pre-commit]
- id: requirements-txt-fixer
stages: [pre-commit]
# Format code blocks in documentation files
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
stages: [pre-commit]
files: \.(md|rst)$
# Format TOML and YAML files with pretty-format hooks
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-toml
args:
- --autofix
- --indent
- '4'
stages: [pre-commit]
files: \.toml$
- id: pretty-format-yaml
args:
- --autofix
- --indent
- '4'
stages: [pre-commit]
files: \.ya?ml$
# clean output from jupyter notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout