File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ DOCKER_TAG_KITCHEN_TERRAFORM ?= ${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}
2424DOCKER_IMAGE_KITCHEN_TERRAFORM := cft/kitchen-terraform_terraform-google-kubernetes-engine
2525
2626# All is the first target in the file so it will get picked up when you just run 'make' on its own
27- all : check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace generate_docs
27+ .PHONY : all
28+ all : check generate_docs
29+
30+ .PHONY : check
31+ check : check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace check_generate_docs
2832
2933# The .PHONY directive tells make that this isn't a real target and so
3034# the presence of a file named 'check_shell' won't cause this target to stop
@@ -71,6 +75,10 @@ check_headers:
7175 @echo " Checking file headers"
7276 @python test/verify_boilerplate.py
7377
78+ .PHONY : check_generate_docs
79+ check_generate_docs : # # Check that `make generate_docs` does not generate a diff
80+ @source test/make.sh && check_generate_docs
81+
7482# Integration tests
7583.PHONY : test_integration
7684test_integration :
Original file line number Diff line number Diff line change @@ -96,3 +96,22 @@ function generate_docs() {
9696 done
9797 rm -f " $TMPFILE "
9898}
99+
100+ function check_generate_docs() {
101+ TMPDIR=$( mktemp -d)
102+ git worktree add --detach " $TMPDIR " > /dev/null
103+ cd " $TMPDIR " || exit 1
104+
105+ make generate_docs > /dev/null
106+ git diff --stat --exit-code > /dev/null
107+ rc=$?
108+ cd - > /dev/null || exit 1
109+
110+ if [[ $rc -ne 0 ]]; then
111+ echo ' "make generate_docs" creates a diff, run "make generate_docs" and commit the results'
112+ fi
113+ rm -rf " $TMPDIR "
114+ git worktree prune > /dev/null
115+
116+ exit $rc
117+ }
You can’t perform that action at this time.
0 commit comments