Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency @biomejs/biome to v1.8.0 #50

Merged
merged 6 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions lib/biome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ biome_check() {
echo "❌ biome_check requires at least one argument"
exit 1
fi
# shellcheck disable=SC2086
"$(npm root)"/.bin/biome check --apply $1 2>&1 1>/dev/null |
sed 's/ *$//' |
awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }'

biome_version=$("$(npm root)"/.bin/biome --version)
if awk -v ver="$biome_version" 'BEGIN { if (ver >= 1.8) exit 1; }'; then
# The following processes will be removed when biome 2.0.0 is released
# shellcheck disable=SC2086
"$(npm root)"/.bin/biome check --apply $1 2>&1 1>/dev/null |
sed 's/ *$//' |
awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }'
else
# shellcheck disable=SC2086
"$(npm root)"/.bin/biome check --write $1 2>&1 1>/dev/null |
sed 's/ *$//' |
awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }'
fi
}

biome_ci() {
Expand All @@ -34,6 +44,9 @@ biome_ci() {
fi
# shellcheck disable=SC2086
"$(npm root)"/.bin/biome ci --max-diagnostics=30 $1 2>&1 1>/dev/null |
sed 's/\x1B\[[0-9;]*[JKmsu]//g' |
sed 's/✖/×/g' |
sed 's/ℹ/i/g' |
sed 's/ *$//' |
awk 'BEGIN { RS=""; ORS="\n\n" } { if (index($0, "│") > 0) { print " ```\n" $0 "\n ```" } else { print $0 } }'
}
79 changes: 44 additions & 35 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/shellspec/script_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Describe 'biome.sh'
Include lib/biome.sh
cd test || exit

# Undo changes made by `biome check --apply` command
# Undo changes made by `biome check --write` command
setup() {
cp -r testdata testdata_origin
}
Expand Down
Loading