test: `shfmt`

My apologies to future `git blame` hunters ♥
pull/2106/head
John D Pell 2022-03-04 14:21:24 -08:00
parent 810c52f91a
commit d37505b636
20 changed files with 1688 additions and 1695 deletions

View File

@ -20,7 +20,6 @@ repos:
- id: git-check # Configure in .gitattributes
- id: shellcheck
- id: shfmt
exclude: ".bats$"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:

View File

@ -534,8 +534,7 @@ function __migrate_all_components() {
one_type="${2:-}"
priority="${3:-}"
for f in "${BASH_IT}/$subdirectory/available/"*.bash
do
for f in "${BASH_IT}/$subdirectory/available/"*.bash; do
to_enable=$(basename "$f")
if [[ -z "$priority" ]]; then
ln -s "../available/$to_enable" "${BASH_IT}/${subdirectory}/enabled/$to_enable"

View File

@ -43,7 +43,6 @@ function local_setup_file() {
assert_output "ERROR: default: test test test"
}
@test "lib log: basic debug logging with BASH_IT_LOG_LEVEL_ERROR" {
BASH_IT_LOG_LEVEL=${BASH_IT_LOG_LEVEL_ERROR?}
run _log_debug "test test test"

View File

@ -23,12 +23,10 @@ function local_setup() {
assert_success
assert_line -n 0 ' aliases: git gitsvn '
assert_line -n 1 -p ' plugins:'
for plugin in "autojump" "git" "gitstatus" "git-subrepo" "jgitflow" "jump"
do
for plugin in "autojump" "git" "gitstatus" "git-subrepo" "jgitflow" "jump"; do
assert_line -n 1 -p "$plugin"
done
for completion in "git" "git_flow" "git_flow_avh" "github-cli"
do
for completion in "git" "git_flow" "git_flow_avh" "github-cli"; do
assert_line -n 2 -p "$completion"
done
}

View File

@ -204,8 +204,7 @@ function setup_upower {
printf '%s\n' "$BAT0" "/org/freedesktop/UPower/devices/mouse_hid_${RANDOM}_battery"
;;
'-i' | '--show-info')
if [[ $2 == "$BAT0" ]]
then
if [[ $2 == "$BAT0" ]]; then
printf "voltage: 12.191 V\n time to full: 57.3 minutes\n percentage: %s\n capacity: 84.6964" "${percent}"
else
false

View File

@ -7,8 +7,7 @@ function local_setup_file() {
setup_libs "helpers"
}
function setup_go_path()
{
function setup_go_path() {
local go_path="$1"
# Make sure that the requested GO folder is available