File tree Expand file tree Collapse file tree 2 files changed +214
-0
lines changed Expand file tree Collapse file tree 2 files changed +214
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ skip_lint="${SKIP_LINT_COMMIT}"
33
33
# Get the path to a file containing the commit message:
34
34
commit_message=" $1 "
35
35
36
+ # Determine root directory:
37
+ root=$( git rev-parse --show-toplevel)
38
+
39
+ # Define the path to a report generated during the pre-commit hook:
40
+ pre_commit_report=" ${root} /.git/hooks-cache/pre_commit_report.yml"
41
+
36
42
37
43
# FUNCTIONS #
38
44
@@ -68,6 +74,13 @@ lint() {
68
74
return 0
69
75
}
70
76
77
+ # Appends a report generated during the pre-commit hook.
78
+ append_pre_commit_report () {
79
+ echo ' ' >> " ${commit_message} "
80
+ cat " ${pre_commit_report} " >> " ${commit_message} "
81
+ return 0
82
+ }
83
+
71
84
# Main execution sequence.
72
85
main () {
73
86
init
@@ -78,6 +91,10 @@ main() {
78
91
if [[ " $? " -ne 0 ]]; then
79
92
on_error 1
80
93
fi
94
+ append_pre_commit_report
95
+ if [[ " $? " -ne 0 ]]; then
96
+ on_error 1
97
+ fi
81
98
cleanup
82
99
exit 0
83
100
}
You can’t perform that action at this time.
0 commit comments