time-to-botec/squiggle/node_modules/@quri/squiggle-lang/lint.sh
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

42 lines
875 B
Bash
Executable File

#!/usr/bin/env bash
# Hat tip to @dfalling
# https://forum.rescript-lang.org/t/rescript-9-1-how-can-we-format-to-standard-out/1590/2?u=quinn-dougherty
errors=false
files=`ls src/rescript/**/**/*.res src/rescript/**/*.res src/rescript/*.res`
for file in $files
do
current=`cat $file`
linted=`echo "${current}" | rescript format -stdin .res`
diff=`diff <(echo "$current") <(echo "$linted")`
if [ ${#diff} -gt 0 ]
then
echo "ERROR: $file doesn't pass lint"
errors=true
fi
done
files=`ls src/rescript/**/*.resi` # src/rescript/*/resi
for file in $files
do
current=`cat $file`
linted=`echo "${current}" | rescript format -stdin .resi`
diff=`diff <(echo "$current") <(echo "$linted")`
if [ ${#diff} -gt 0 ]
then
echo "ERROR: $file doesn't pass lint"
errors=true
fi
done
if $errors
then
exit 1
else
echo "All files pass lint"
fi