Skip to content

Commit

Permalink
Fix runtime warnings test
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Nov 4, 2024
1 parent 271714f commit f53941c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion test/error_if_warnings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ grep -E "^warning: .+" --after-context=6 <&0

if [ $? -eq 0 ]
then
exit 1
echo "error: Runtime warnings detected. Exiting ..."
exit 255
else
exit 0
fi
28 changes: 14 additions & 14 deletions test/runtime_warnings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ set -e
mix compile --force --warnings-as-errors


mix credo --mute-exit-status | ./test/error_if_warnings.sh
mix credo --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo --strict --enable-disabled-checks . --mute-exit-status | ./test/error_if_warnings.sh
mix credo --strict --enable-disabled-checks . --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo --strict --enable-disabled-checks . --mute-exit-status --format=json | ./test/error_if_warnings.sh
mix credo --strict --enable-disabled-checks . --mute-exit-status --format=json 2>&1 | ./test/error_if_warnings.sh

mix credo lib/credo.ex --read-from-stdin --strict < lib/credo.ex | ./test/error_if_warnings.sh
mix credo lib/credo.ex --read-from-stdin --strict < lib/credo.ex 2>&1 | ./test/error_if_warnings.sh

mix credo list --mute-exit-status | ./test/error_if_warnings.sh
mix credo list --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo suggest --mute-exit-status | ./test/error_if_warnings.sh
mix credo suggest --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo diff HEAD^ --mute-exit-status | ./test/error_if_warnings.sh
mix credo diff HEAD^ --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo diff v1.4.0 --mute-exit-status | ./test/error_if_warnings.sh
mix credo diff v1.4.0 --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo explain test/fixtures/example_code/clean_redux.ex:1:11 --mute-exit-status | ./test/error_if_warnings.sh
mix credo explain test/fixtures/example_code/clean_redux.ex:1:11 --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo explain Credo.Check.Refactor.Nesting --mute-exit-status | ./test/error_if_warnings.sh
mix credo explain Credo.Check.Refactor.Nesting --mute-exit-status 2>&1 | ./test/error_if_warnings.sh

mix credo categories | ./test/error_if_warnings.sh
mix credo categories 2>&1 | ./test/error_if_warnings.sh

mix credo info --verbose | ./test/error_if_warnings.sh
mix credo info --verbose 2>&1 | ./test/error_if_warnings.sh

mix credo version | ./test/error_if_warnings.sh
mix credo version 2>&1 | ./test/error_if_warnings.sh

mix credo help | ./test/error_if_warnings.sh
mix credo help 2>&1 | ./test/error_if_warnings.sh


echo ""
Expand Down

0 comments on commit f53941c

Please sign in to comment.