From af3cab01bc666fbf5674a98b1c53c45726622387 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 11 Apr 2022 09:35:25 -0400 Subject: [PATCH] added `.resi` files to lint checker --- packages/squiggle-lang/lint.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/lint.sh b/packages/squiggle-lang/lint.sh index 892fd1bc..071823c9 100755 --- a/packages/squiggle-lang/lint.sh +++ b/packages/squiggle-lang/lint.sh @@ -3,8 +3,9 @@ # 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 -files=`ls src/rescript/**/**/*.res src/rescript/**/*.res src/rescript/*.res` errors=false + +files=`ls src/rescript/**/**/*.res src/rescript/**/*.res src/rescript/*.res` for file in $files do current=`cat $file` @@ -18,9 +19,23 @@ do fi done +files=`ls src/rescript/**/**/*.resi 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 linting!" + echo "All files pass lint" fi \ No newline at end of file