From 315df657afffd336169da6d552b807ce041eec0e Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Fri, 30 Aug 2019 01:18:33 +0000 Subject: [PATCH] travis: reject invalid UUIDs Want to prevent any invalid UUIDs from being entered. Want to put this in configlet lint, but can't: https://github.com/exercism/configlet/issues/99 https://github.com/exercism/configlet/pull/168 So it will go in individual tracks' .travis.yml for now. It appears that the site will accept pretty much arbitrary strings as UUIDs for now, but we want to make less work for ourselves when valid UUIDs are required. --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 68352a3..604ef43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,15 @@ script: - bin/configlet lint . - bin/compile-all-stubs - bin/test-all-exercises + - | + # Check for invalid UUIDs. + # can be removed once `configlet lint` gains this ability. + # Check issue https://github.com/exercism/configlet/issues/99 + bad_uuid=$(jq --raw-output '.exercises | map(.uuid) | .[]' config.json | grep -vE '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$') + if [ -n "$bad_uuid" ]; then + echo "invalid UUIDs\n$bad_uuid" + exit 1 + fi - | if ! ceylon format exercises; then echo "'ceylon format' couldn't run!"