-
Notifications
You must be signed in to change notification settings - Fork 16
/
.pre-commit-config.yaml
130 lines (125 loc) · 4.03 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
name: "[py - check] check toml"
- id: end-of-file-fixer
name: "[py - check] validate yaml"
- id: no-commit-to-branch
name: "[git - check] no commit to branch"
args: [ --branch=main ]
- id: trailing-whitespace
name: "[file - format] trim trailing whitespace"
args: [ --markdown-linebreak-ext=md ]
- id: check-added-large-files
name: "[file - check] large file"
args: [ --maxkb=2000 ]
- id: check-docstring-first
name: "[py - check] docstring first"
files: /examples
types : [file, python ]
- id: check-json
name: "[json - check] validate json"
- id: check-merge-conflict
name: "[git - check] merge conflict"
- id: debug-statements
name: "[py - check] debug statements"
- id: detect-private-key
name: "[cred - check] private keys"
- id: fix-encoding-pragma
name: "[file - format] coding pragma"
args: [ --remove ]
- id: mixed-line-ending
name: "[file - format] mixed line ending"
args: [ --fix=auto ]
- id: pretty-format-json
name: "[json - format] pretty json"
args: [ --autofix,
--indent=4,
--no-sort-keys ]
- id: requirements-txt-fixer
name: "[reqs - format] fix requirements.txt"
- id: check-yaml
name: "[yaml - check] validate yaml"
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
name: "[py - check] flake8"
exclude: ^(examples/|tests/)
# - repo: https://github.com/pycqa/docformatter
# rev: v1.4
# hooks:
# - id: docformatter
# name: "[py - format] docformatter"
# description: 'Formats docstrings to follow PEP 257.'
# entry: docformatter
# args: [-i]
# language: python
# types: [python]
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
name: "[py - check] pydocstyle"
files: ^src/.*\.py$
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: "[py - format] isort"
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
hooks:
- id: beautysh
name: "[bash - format] beautysh"
- repo: https://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
- id: shell-lint
name: "[bash - lint] shell-lint"
- repo: https://github.com/rlindsgaard/pre-commit-commit-msg-hooks
rev: 0.1.0
hooks:
- id: check-description-max-length
name: "[bash - format] check-description-max-length"
- id: check-second-line-empty
name: "[bash - format] check-second-line-empty"
- id: check-summary-capitalized
name: "[bash - format] check-summary-capitalized"
- id: check-summary-imperative
name: "[bash - format] check-summary-imperative"
- id: check-summary-max-length
name: "[bash - format] check-summary-max-length"
- id: check-summary-punctuation
name: "[bash - format] check-summary-punctuation"
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest -vvv --cov=src/Hapi --cov-report term-missing -m "not fig_share"
language: system
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: examples-notebook-check
name: nbval
entry: pytest --nbval
language: system
files: \.ipynb$
- repo: local
hooks:
- id: doctest
name: doctest
entry: pytest --doctest-modules
args: ["--doctest-glob=*.rst", "-o", "doctest_optionflags=NORMALIZE_WHITESPACE ELLIPSIS"]
language: system
files: ^src/.*\.py$