forked from longGGGGGG/sgl-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
40 lines (36 loc) · 1.42 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
40 lines (36 loc) · 1.42 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
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# Custom hook for compiling model configs
- repo: local
hooks:
- id: compile-model-configs
name: Compile Model Configuration YAML
entry: python3 data/scripts/compile_models.py
language: system
files: ^data/models/src/.*\.(yaml|yml)$
pass_filenames: false
- id: validate-model-configs-ts
name: Validate Model Configuration YAML (TypeScript)
entry: bash -c 'cd data/schema && npm test'
language: system
files: ^(data/models/generated/.*\.(yaml|yml)|data/schema/types\.ts)$
pass_filenames: false
- id: compile-optimal-configs
name: Compile Optimal Configuration YAML
entry: bash -c 'source .venv/bin/activate 2>/dev/null || true && python3 data/scripts/compile_optimal_configs.py'
language: system
files: ^data/optimal-configs/src/.*\.(yaml|yml)$
pass_filenames: false
- id: validate-optimal-configs-ts
name: Validate Optimal Configuration (TypeScript)
entry: bash -c 'cd data/schema && npm run test:optimal'
language: system
files: ^(data/optimal-configs/generated/.*\.json|data/schema/optimal-config.*\.ts)$
pass_filenames: false