-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
120 lines (108 loc) · 3.44 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
---
exclude: (pipelines/report-.*)|(pipelines/.*.txt)|(data_model/src/linkml_crystalia/datamodel/.*.py)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# General
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: trailing-whitespace
# Json
- id: check-json
- id: pretty-format-json # Checks that all your JSON files are pretty.
args: ['--indent', '2', '--autofix']
exclude: \.ipynb
# Python
- id: check-ast # Check whether files parse as valid python.
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types.
- id: check-docstring-first
- id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source.
- id: name-tests-test # Assert that files in tests/ end in _test.py, or optionally test*.py
args: [--pytest-test-first]
- id: requirements-txt-fixer
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks
rev: v0.1.0
hooks:
- id: dockerfilelint
- repo: https://github.com/hadolint/hadolint
rev: v2.13.0-beta
hooks:
- id: hadolint
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.14
hooks:
- id: mdformat
additional_dependencies:
- mdformat-beautysh
- mdformat-black
- mdformat-config
- mdformat-deflist
# - mdformat-frontmatter # Breaks.
- mdformat-footnote
- mdformat-gfm
- mdformat-shfmt
- mdformat-tables
- mdformat-toc
- repo: https://github.com/ikamensh/flynt/
rev: '1.0.1'
hooks:
- id: flynt
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
args:
- --py36-plus
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0 # Possible releases: https://github.com/hadialqattan/pycln/releases
hooks:
- id: pycln
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.6.2'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi] # Run on notebooks too.
exclude: ^(tests)/
- id: ruff-format
types_or: [python, pyi] # Run on notebooks too.
# YAML
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [-c=.yamllint.yml]
- repo: https://github.com/zricethezav/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint
args: ['--ignore', 'is always evaluated to true']
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.3
hooks:
- id: cspell