-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
88 lines (81 loc) · 3.3 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
88 lines (81 loc) · 3.3 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
# Pre-commit hooks for makit monorepo.
#
# Install: pre-commit install --hook-type pre-push
# Run manually: pre-commit run --all-files
# Update hook revisions: pre-commit autoupdate
#
# Hooks mirror what CI enforces:
# Flutter — dart format + flutter analyze (flutter-ci.yml)
# Server — TypeScript typecheck (server-ci.yml)
default_install_hook_types: [pre-push]
# Generated build output should never trigger hook failures.
exclude: ^server/dist/
repos:
# ---------------------------------------------------------------------------
# General file hygiene
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=1024]
# ---------------------------------------------------------------------------
# Flutter / Dart
# Requires: dart and flutter on PATH (part of Flutter SDK installation).
# ---------------------------------------------------------------------------
- repo: local
hooks:
- id: dart-format
name: dart format
description: >
Fail if staged Dart files are not formatted.
Fix: run `dart format <file>` and re-stage.
language: system
entry: dart format --set-exit-if-changed
files: ^app/.*\.dart$
types: [file]
- id: flutter-analyze
name: flutter analyze
description: >
Run Flutter static analysis (fatal-infos, matching CI).
Fix: address the reported warnings/errors.
language: system
entry: bash -c 'cd app && env -u GIT_DIR -u GIT_INDEX_FILE -u GIT_WORK_TREE sh -c "flutter pub get && flutter analyze --no-pub --fatal-infos"'
files: ^app/.*\.dart$
pass_filenames: false
# ---------------------------------------------------------------------------
# Server (Node.js / TypeScript)
# Requires: pnpm on PATH and `pnpm install` already run in server/.
# ---------------------------------------------------------------------------
- repo: local
hooks:
- id: server-typecheck
name: TypeScript typecheck
description: >
Run `tsc --noEmit` for the server package (matching CI).
Fix: address the reported type errors.
language: system
entry: bash -c 'cd server && pnpm typecheck'
files: ^server/.*\.(ts|js|json)$
pass_filenames: false
# ---------------------------------------------------------------------------
# Licensing
# Requires: python3 and pnpm on PATH; app deps resolved in the pub cache.
# ---------------------------------------------------------------------------
- repo: local
hooks:
- id: third-party-licenses
name: THIRD_PARTY_LICENSES up to date
description: >
Fail if THIRD_PARTY_LICENSES.md is stale relative to the dependency
manifests. Fix: run `python3 scripts/gen_third_party_licenses.py`
and re-stage.
language: system
entry: python3 scripts/gen_third_party_licenses.py --check
files: ^(server/package\.json|server/pnpm-lock\.yaml|app/pubspec\.(yaml|lock))$
pass_filenames: false