forked from SankethBK/diaryvault
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
31 lines (25 loc) · 675 Bytes
/
pre-commit
File metadata and controls
31 lines (25 loc) · 675 Bytes
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
#!/usr/bin/env bash
# Max line length for Dart files.
LINE_LENGTH=80
echo
echo "Running Dart Format, please wait…"
echo
if ! dart --disable-analytics format --fix --line-length $LINE_LENGTH "."; then
echo
echo "Fatal: Dart Format exited with an error. Please fix the issues and commit again."
echo
exit 1
fi
echo
echo "Running Dart Analysis, please wait…"
echo
# Run Dart Analysis on all modules.
if ! flutter --suppress-analytics analyze --no-pub "."; then
echo
echo "Dart Analysis found some issues. Please fix the issues and commit again."
echo
exit 1
fi
echo
echo "Dart Analysis found no issues, congratulations! Continuing with commit…"
echo