Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis: reject invalid UUIDs #862

Merged
merged 3 commits into from
Aug 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ script:
- "./_test/check-configlet-fmt.sh"
- "sh ./_test/ensure-readmes-are-updated.sh"
- "./bin/configlet lint ."
- "sh ./_test/check-uuids.sh"
- "./_test/verify-exercise-difficulties.sh"
- "./_test/check-exercises-for-authors.sh"
- "sh ./_test/check-exercise-crate.sh"
Expand Down
13 changes: 13 additions & 0 deletions _test/check-uuids.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

repo=$(cd "$(dirname "$0")/.." && pwd)

# 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) | .[]' $repo/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 found! please correct these to be valid UUIDs:"
echo "$bad_uuid"
exit 1
fi