-
Notifications
You must be signed in to change notification settings - Fork 510
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
36 lines (36 loc) · 1.63 KB
/
.pre-commit-config.yaml
File metadata and controls
36 lines (36 loc) · 1.63 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
repos:
- repo: local
hooks:
- id: ruff-format
name: ruff format
entry: python3 -m ruff format
language: system
types: [python]
- id: ruff-check
name: ruff check
entry: python3 -m ruff check
language: system
types: [python]
- id: prettier-format
name: prettier --write (web)
entry: bash -c 'cd web && pnpm exec prettier --write --cache --log-level warn "**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts,mdx}" --ignore-path ./ee/.gitignore --ignore-path ./oss/.gitignore'
language: system
files: ^web/.*\.(js|jsx|cjs|mjs|ts|tsx|cts|mts|mdx)$
pass_filenames: false
- id: turbo-lint
name: turbo lint (web)
entry: bash -c 'cd web && if [ "$(sysctl -in hw.optional.arm64 2>/dev/null || echo 0)" = "1" ] && [ "$(node -p "process.arch")" = "x64" ]; then arch -arm64 pnpm exec turbo run lint; else pnpm exec turbo run lint; fi'
language: system
files: ^web/.*\.(js|jsx|cjs|mjs|ts|tsx|cts|mts|mdx)$
pass_filenames: false
- id: gitleaks-pre-commit
name: gitleaks git (staged only)
entry: bash -c 'gitleaks --config .gitleaks.toml --exit-code 1 --verbose git --staged'
language: system
pass_filenames: false
- id: gitleaks-pre-push
name: gitleaks git (pre-push, scan diff)
entry: bash -c 'gitleaks --config .gitleaks.toml --exit-code 1 --verbose git --log-opts "$(git merge-base HEAD "origin/$(git rev-parse --abbrev-ref HEAD)" 2>/dev/null || git merge-base HEAD origin/main)..HEAD"'
language: system
stages: [pre-push]
pass_filenames: false