-
Notifications
You must be signed in to change notification settings - Fork 11
/
lefthook.yaml
44 lines (42 loc) · 1.48 KB
/
lefthook.yaml
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
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
pre-push:
parallel: true
commands:
flutter-test:
root: shady_ai_flutter/
run: flutter test
fail_text: "Could not pass tests"
flutter-analyze:
root: "shady_ai_flutter/"
run: |
flutter analyze
# Note: commit-msg hook takes a single parameter,
# the name of the file that holds the proposed commit log message.
# Source: https://git-scm.com/docs/githooks#_commit_msg
commit-msg:
scripts:
# Bash script to ensure the conventional commit standard.
"conventional_commit": # Located in .lefthook/commit-msg/conventional_commit
runner: bash
fail_text: "❌ Commit message does not follow the conventional commit format."
multiple-sign-off:
# Ensure that the commit message has at least two sign-offs
run: 'test $(grep -c "^Signed-off-by: " {1}) -lt 2'
pre-commit:
commands:
dart-fix:
root: shady_ai_flutter/
glob: '*.dart' # Find all .dart files
exclude: '*.{g,freezed}.dart' # Exclude generated dart files
run: dart fix --apply "{staged_files}"
stage_fixed: true # Stage the fixed files
dart-format:
root: shady_ai_flutter/
glob: '*.dart' # Find all .dart files
exclude: '*.{g,freezed}.dart' # Exclude generated dart files
run: dart format "{staged_files}" # Format staged files
stage_fixed: true # Stage the fixed files