-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
151 lines (141 loc) · 3.98 KB
/
.pre-commit-config.yaml
File metadata and controls
151 lines (141 loc) · 3.98 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
# Pre-commit hooks configuration
# Run: pre-commit run --all-files
# Update: pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
name: Check for large files
args: ['--maxkb=1000']
- id: check-case-conflict
name: Check for case conflicts
- id: check-executables-have-shebangs
name: Check executables have shebangs
- id: check-illegal-windows-names
name: Check for illegal Windows filenames
- id: check-json
name: Check JSON syntax
- id: check-merge-conflict
name: Check for merge conflicts
- id: check-shebang-scripts-are-executable
name: Check shebang scripts are executable
- id: check-symlinks
name: Check for broken symlinks
- id: check-toml
name: Check TOML syntax
- id: check-xml
name: Check XML syntax
- id: check-yaml
name: Check YAML syntax
- id: end-of-file-fixer
name: Fix end of file
- id: debug-statements
name: Check for debug statements
- id: destroyed-symlinks
name: Check for destroyed symlinks
- id: detect-private-key
name: Detect private keys
- id: detect-aws-credentials
name: Detect AWS credentials
args:
- --allow-missing-credentials
- id: forbid-submodules
name: Forbid submodules
- id: pretty-format-json
name: Pretty format JSON
exclude: ^docusaurus\/package-lock.json$
args:
- --autofix
- id: trailing-whitespace
name: Trim trailing whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
name: Ruff linter
args:
- --fix
- id: ruff-format
name: Ruff formatter
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
name: Detect secrets
args:
- --baseline
- .secrets.baseline
- repo: local
hooks:
- id: shellcheck
name: ShellCheck
language: system
entry: shellcheck
args:
- --severity=warning
- --shell=bash
types: [shell]
files: \.(sh|bash)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
name: Markdown lint
args:
- --config
- .markdownlint.yaml
- --fix
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.21.0
hooks:
- id: commitlint
name: Commit message lint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
- repo: local
hooks:
- id: pyright
name: Pyright type checker
pass_filenames: true
language: system
entry: >-
bash -c 'for x in "$@"; do
(cd `dirname $x`; pwd;
uv run --frozen --all-extras --dev pyright --stats;);
done;' --
stages:
- pre-push
files: (src|samples)\/.*\/pyproject.toml
- id: pytest
name: Pytest unit tests
pass_filenames: true
language: system
entry: >-
bash -c 'for x in "$@"; do
(cd `dirname $x`; pwd;
uv run --frozen pytest --cov --cov-branch
--cov-report=term-missing;);
done;' --
stages:
- pre-push
files: src\/.*\/pyproject.toml
- id: pre-commit-autoupdate-reminder
name: Pre-commit autoupdate reminder
language: system
entry: >-
bash -c 'echo "Run: pre-commit autoupdate"'
always_run: false
pass_filenames: false
stages:
- manual
# To run autoupdate manually:
# pre-commit autoupdate
#
# To run all hooks:
# pre-commit run --all-files
#
# To install hooks:
# pre-commit install
# pre-commit install --hook-type commit-msg