forked from thedaviddias/llms-txt-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
105 lines (91 loc) 路 2.98 KB
/
Copy pathlefthook.yml
File metadata and controls
105 lines (91 loc) 路 2.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
# Lefthook Configuration
# Using existing validation scripts
pre-commit:
parallel: true
commands:
# Code formatting and linting
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
# Package.json sorting
sort-package-json:
glob: "**/{package.json}"
exclude: "node_modules/**"
run: pnpm dlx sort-package-json {staged_files}
stage_fixed: true
# MDX content validation
check-frontmatter:
glob: "packages/content/data/websites/*.mdx"
run: pnpm tsx scripts/check-frontmatter.ts {staged_files}
check-mdx-length:
glob: "packages/content/data/websites/*.mdx"
run: pnpm tsx scripts/check-mdx-length.ts {staged_files}
# TypeScript as casts validation
check-as-casts:
glob: "**/*.{ts,tsx}"
exclude:
- "**/node_modules/**"
- "**/*.test.*"
- "**/*.spec.*"
run: node scripts/validation/check-as-casts.js {staged_files}
# Barrel files validation
check-barrel-files:
glob: "**/index.{js,ts,jsx,tsx}"
exclude: "**/node_modules/**"
run: node scripts/validation/check-barrel-files.js {staged_files}
# Console logs validation
check-console-logs:
glob: "**/*.{js,jsx,ts,tsx}"
exclude:
- "**/node_modules/**"
- "**/*.test.*"
- "**/*.spec.*"
- "scripts/**"
- "**/scripts/**"
- "packages/validators/**"
- "**/packages/validators/**"
- "packages/generator/**"
- "**/packages/generator/**"
- "packages/cli/**"
- "**/packages/cli/**"
run: node scripts/validation/check-console-logs.js {staged_files}
# Directory structure validation
check-directory-structure:
run: node scripts/validation/check-directory-structure.js
# File complexity validation
check-file-complexity:
glob: "**/*.{js,jsx,ts,tsx}"
exclude:
- "**/node_modules/**"
- "**/*.test.*"
- "**/*.spec.*"
run: node scripts/validation/check-file-complexity.js {staged_files}
# JSDoc validation
check-jsdoc:
glob: "**/*.{js,jsx,ts,tsx}"
exclude:
- "**/node_modules/**"
- "**/*.test.*"
- "**/*.spec.*"
run: node scripts/validation/check-jsdoc.js {staged_files}
# Relative imports validation
check-relative-imports:
glob: "apps/web/**/*.{ts,tsx,js,jsx}"
exclude: "apps/web/**/node_modules/**"
run: pnpm tsx scripts/check-relative-imports.ts {staged_files}
# Test modified test files
test-modified:
glob: "apps/web/**/*.{test,spec}.{js,ts,tsx}"
run: cd apps/web && pnpm test:related {staged_files}
# Pre-push validation
pre-push:
commands:
# Run tests
test-all:
run: turbo test --filter=web
# Commit message validation
commit-msg:
commands:
lint-commit-message:
run: pnpm commitlint --edit {1}