Main coves client
1# Lefthook configuration for Coves Flutter app
2#
3# Install on PopOS/Ubuntu/Debian:
4# curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | sudo -E bash
5# sudo apt install lefthook
6#
7# Setup (after install):
8# lefthook install
9#
10# This will auto-format and analyze code before commits!
11
12pre-commit:
13 parallel: true
14 commands:
15 # Format Dart code automatically
16 format:
17 glob: "*.dart"
18 run: dart format {staged_files} && git add {staged_files}
19
20 # Analyze staged Dart files
21 analyze:
22 glob: "*.dart"
23 run: flutter analyze {staged_files}
24
25 # Check for TODOs in production code (optional - comment out if annoying)
26 # check-todos:
27 # glob: "*.dart"
28 # exclude: "test/"
29 # run: |
30 # if grep -r "TODO:" {staged_files}; then
31 # echo "⚠️ Warning: TODOs found in staged files"
32 # fi
33
34pre-push:
35 commands:
36 # Full analyze before push
37 analyze:
38 run: flutter analyze
39
40 # Run all tests before push
41 test:
42 run: flutter test
43
44 # Verify formatting
45 format-check:
46 run: dart format --output=none --set-exit-if-changed .