From 8b64ff0b32430dda84d2c632692c57d2f0ce89e4 Mon Sep 17 00:00:00 2001 From: xpetit <32063953+xpetit@users.noreply.github.com> Date: Thu, 17 Sep 2020 17:22:18 +0200 Subject: [PATCH] Prepare test image for exam and make some messages more explicit --- go/tests/entrypoint.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/go/tests/entrypoint.sh b/go/tests/entrypoint.sh index d903e164d..17a5dfbcc 100755 --- a/go/tests/entrypoint.sh +++ b/go/tests/entrypoint.sh @@ -18,16 +18,21 @@ else cat > "$first_file" fi -# Check formatting -s=$(goimports -d .) -if test "$s"; then - echo '$ goimports -d .' - echo "$s" - exit 1 +set +o nounset # TODO: Remove me after this variable is always set in all/tester/main.go +if test "$SKIP_FORMATTING"; then + s=$(goimports -d .) + if test "$s"; then + echo 'Your Go files are not correctly formatted :' + echo + echo '$ goimports -d .' + echo "$s" + exit 1 + fi fi +set -o nounset # TODO: Remove me after this variable is always set in all/tester/main.go if find . -type f -name '*.go' -exec grep -qE '\tprint(ln)?\(' {} +; then - echo "print & println builtins are forbidden" + echo "Your Go files cannot use print & println builtins" exit 1 fi