-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
101 lines (94 loc) · 2.49 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
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
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See:
# https://pre-commit.com/ and
# https://github.com/pre-commit/pre-commit for more information
# https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.11
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
# - id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
exclude: notebooks
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: data|.ipynb$|^\.
- id: name-tests-test
args:
- --pytest-test-first
# - id: no-commit-to-branch
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: data|.ipynb$
# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.4"
hooks:
- id: remove-tabs
# Format doc strings
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: "v0.7.3"
hooks:
- id: pydocstringformatter
exclude: _parser\.py$|_tab\.py
- repo: local
hooks:
# Upgrade Python code
- id: pyupgrade
name: pyupgrade
exclude: \.idea|\.cache|^notebooks
entry: pyupgrade
args:
- --py39-plus
language: system
types: [ python ]
# Nicely sort imports
- id: isort
name: isort
exclude: tools|\.idea|\.cache|^notebooks
entry: isort
language: system
types: [ python ]
# Black, the code formatter, natively supports pre-commit
- id: black
name: black
entry: black
language: system
types: [ python ]
exclude: ^notebooks
# Lint
- id: ruff
name: ruff
entry: ruff --force-exclude --fix --config pyproject.toml
language: system
types: [ python ]
exclude: ^notebooks
# Check for common shell mistakes
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
hooks:
- id: shellcheck
stages: [ manual ]