Skip to content

Commit

Permalink
Add a check that semver files don't contain duplicate entries
Browse files Browse the repository at this point in the history
Also make shellcheck failures actually cause an exit, `find ... -exec`
apparently does not propagate errors.
  • Loading branch information
tgross35 committed Nov 17, 2024
1 parent fffcd4b commit 1568789
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ci/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rustfmt -V
cargo fmt --all -- --check

if shellcheck --version ; then
find . -name '*.sh' -exec shellcheck {} ';'
find . -name '*.sh' -print0 | xargs -0 shellcheck
else
echo "shellcheck not found"
exit 1
Expand All @@ -29,4 +29,12 @@ for file in libc-test/semver/*.txt; do
echo "Unsorted semver file $file"
exit 1
fi

duplicates=$(uniq -d "$file")
if [ -n "$duplicates" ]; then
echo "Semver file $file contains duplicates:"
echo "$duplicates"

exit 1
fi
done

0 comments on commit 1568789

Please sign in to comment.