mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
ci: explicitly set shell in lint & format scripts (#1391)
This commit is contained in:
parent
33bc2e0738
commit
ea18e96bc0
@ -94,6 +94,7 @@ plugin_add_command() {
|
||||
if [ -f "${plugin_path}/bin/post-plugin-add" ]; then
|
||||
(
|
||||
export ASDF_PLUGIN_SOURCE_URL=$source_url
|
||||
# shellcheck disable=SC2030
|
||||
export ASDF_PLUGIN_PATH=$plugin_path
|
||||
"${plugin_path}/bin/post-plugin-add"
|
||||
)
|
||||
@ -153,6 +154,7 @@ update_plugin() {
|
||||
|
||||
if [ -f "${plugin_path}/bin/post-plugin-update" ]; then
|
||||
(
|
||||
# shellcheck disable=SC2031
|
||||
export ASDF_PLUGIN_PATH=$plugin_path
|
||||
export ASDF_PLUGIN_PREV_REF=$prev_ref
|
||||
export ASDF_PLUGIN_POST_REF=$post_ref
|
||||
|
27
scripts/format.bash
Executable file
27
scripts/format.bash
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# check .sh files
|
||||
# TODO(jthegedus): unlock this check later
|
||||
# TODO shfmt --language-dialect posix --indent 2 --write \
|
||||
# TODO asdf.sh \
|
||||
# TODO lib/*.sh
|
||||
|
||||
# check .bash files
|
||||
shfmt --language-dialect bash --indent 2 --write \
|
||||
completions/*.bash \
|
||||
bin/asdf \
|
||||
bin/private/asdf-exec \
|
||||
lib/utils.bash \
|
||||
lib/commands/*.bash \
|
||||
lib/functions/*.bash \
|
||||
scripts/*.bash \
|
||||
test/test_helpers.bash \
|
||||
test/fixtures/dummy_broken_plugin/bin/* \
|
||||
test/fixtures/dummy_legacy_plugin/bin/* \
|
||||
test/fixtures/dummy_plugin/bin/*
|
||||
|
||||
# check .bats files
|
||||
shfmt --language-dialect bats --indent 2 --write \
|
||||
test/*.bats
|
@ -2,13 +2,27 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
exec shellcheck -s bash -x \
|
||||
asdf.sh \
|
||||
# check .sh files
|
||||
# TODO(jthegedus): unlock this check later
|
||||
# TODO shellcheck --shell sh --external-sources \
|
||||
# TODO asdf.sh \
|
||||
# TODO lib/*.sh
|
||||
|
||||
# check .bash files
|
||||
shellcheck --shell bash --external-sources \
|
||||
completions/*.bash \
|
||||
bin/asdf \
|
||||
bin/private/asdf-exec \
|
||||
lib/utils.bash \
|
||||
lib/commands/*.bash \
|
||||
lib/functions/*.bash \
|
||||
scripts/*.bash \
|
||||
test/test_helpers.bash \
|
||||
test/fixtures/dummy_broken_plugin/bin/* \
|
||||
test/fixtures/dummy_legacy_plugin/bin/* \
|
||||
test/fixtures/dummy_plugin/bin/*
|
||||
|
||||
# check .bats files
|
||||
# TODO(jthegedus): unlock this check later
|
||||
# TODO shellcheck --shell bats --external-sources \
|
||||
# TODO test/*.bats
|
||||
|
@ -2,4 +2,26 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
exec shfmt -d .
|
||||
# check .sh files
|
||||
# TODO(jthegedus): unlock this check later
|
||||
# TODO shfmt --language-dialect posix --indent 2 --diff \
|
||||
# TODO asdf.sh \
|
||||
# TODO lib/*.sh
|
||||
|
||||
# check .bash files
|
||||
shfmt --language-dialect bash --indent 2 --diff \
|
||||
completions/*.bash \
|
||||
bin/asdf \
|
||||
bin/private/asdf-exec \
|
||||
lib/utils.bash \
|
||||
lib/commands/*.bash \
|
||||
lib/functions/*.bash \
|
||||
scripts/*.bash \
|
||||
test/test_helpers.bash \
|
||||
test/fixtures/dummy_broken_plugin/bin/* \
|
||||
test/fixtures/dummy_legacy_plugin/bin/* \
|
||||
test/fixtures/dummy_plugin/bin/*
|
||||
|
||||
# check .bats files
|
||||
shfmt --language-dialect bats --indent 2 --diff \
|
||||
test/*.bats
|
||||
|
Loading…
Reference in New Issue
Block a user