Skip to content

Commit

Permalink
test: Catch possible errors in the yamlfmt test
Browse files Browse the repository at this point in the history
We should not use -o errfail because that will not give diagnostic
ouput. But we should catch errors from as many places as possible.
  • Loading branch information
ffrank committed Feb 27, 2024
1 parent cd4038f commit 301320d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test-yamlfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# check for any yaml files that aren't properly formatted

echo running "$0"
set -o pipefail

#ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" # dir!
ROOT=$(dirname "${BASH_SOURCE}")/..
Expand All @@ -14,7 +15,8 @@ if [ -z "$LINTER" ]; then
fi

find_files() {
git ls-files | grep '\.yaml$'
git ls-files | grep '\.yaml$' \
|| fail_test "Could not find yaml files via git ls-files"
}

bad_files=$(
Expand Down

0 comments on commit 301320d

Please sign in to comment.