-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
54 lines (49 loc) · 1.6 KB
/
.pre-commit-config.yaml
File metadata and controls
54 lines (49 loc) · 1.6 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
# pre-commit is a tool to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
#
# Common tasks
#
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
repos:
# Autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: f0fe93c067104b76ffb58852abe79673a8429bd1 # frozen: v0.11.8
hooks:
- id: ruff
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
- id: ruff-format
# Autoformat: markdown, yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3
hooks:
- id: prettier
exclude: tests/.*
# Misc...
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
hooks:
# Sanity checks
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-merge-conflict
# Checks based on file type
- id: check-toml
- id: check-yaml
# Detect mistakes
- id: debug-statements
- id: detect-private-key
- id: forbid-submodules
# Automatic fixes
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: end-of-file-fixer
exclude: tests/.*