-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlefthook.yml
More file actions
67 lines (55 loc) · 1.85 KB
/
Copy pathlefthook.yml
File metadata and controls
67 lines (55 loc) · 1.85 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
pre-commit:
parallel: true
fail_on_changes: "always"
commands:
# Security
gitleaks:
root: frontend
run: pnpm exec gitleaks-secret-scanner protect --staged --verbose --redact
# Python (FastAPI/Backend)
black:
root: backend/app
glob: "**/*.py"
run: black {staged_files}
flake8:
root: backend/app
glob: "**/*.py"
run: flake8 {staged_files}
pyright:
glob: "backend/app/**/*.py"
run: PYTHONPATH=backend pyright {staged_files}
# JavaScript/TypeScript (React/Frontend)
eslint:
root: frontend
glob: "**/*.{js,mjs,cjs,jsx,ts,tsx}"
run: pnpm exec eslint {staged_files}
prettier:
root: frontend
glob: "**/*.{js,mjs,cjs,jsx,ts,tsx,css,json,md,yml,yaml}"
run: pnpm exec prettier --write {staged_files}
vitest-related:
root: frontend
glob: "**/*.{js,jsx,ts,tsx}"
run: pnpm exec vitest related --run {staged_files}
# End-to-end tests (Playwright at repository root)
e2e-eslint:
glob: "{e2e/**/*.ts,playwright.config.ts}"
run: ./frontend/node_modules/.bin/eslint --config frontend/eslint.config.js {staged_files}
e2e-prettier:
glob: "{e2e/**/*.ts,playwright.config.ts,package.json,package-lock.json,lefthook.yml,.github/workflows/pre-commit.yaml}"
run: ./frontend/node_modules/.bin/prettier --write {staged_files}
e2e-list:
glob: "{e2e/**/*.ts,playwright.config.ts,package.json,package-lock.json}"
run: npm run test:e2e -- --list
# Documentation
markdownlint:
glob: "docs/**/*.md"
run: npm_config_yes=true npx markdownlint-cli2 {staged_files} --fix
prettier-docs:
glob: "docs/**/*.md"
run: npm_config_yes=true npx prettier --write {staged_files}
commit-msg:
commands:
commitlint:
root: frontend
run: pnpm exec commitlint --edit {1}