Skip to content

Commit

Permalink
travis: reject invalid UUIDs
Browse files Browse the repository at this point in the history
Want to prevent any invalid UUIDs from being entered.

Want to put this in configlet lint, but can't:
exercism/configlet#99
exercism/configlet#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.
  • Loading branch information
petertseng committed Aug 30, 2019
1 parent 53c994e commit 315df65
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down

0 comments on commit 315df65

Please sign in to comment.