Skip to content

Commit d7176d4

Browse files
committed
lib/helpers: some SC2034 fixes
And SC2154 in `_make_reload_alias()`
1 parent e618eef commit d7176d4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/helpers.bash

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ BASH_IT_LOAD_PRIORITY_SEPARATOR="---"
1414
# To use this in Bash-it for inline replacements with `sed`, use the following syntax:
1515
# sed "${BASH_IT_SED_I_PARAMETERS[@]}" -e "..." file
1616
BASH_IT_SED_I_PARAMETERS=(-i)
17+
# shellcheck disable=SC2034 # expected for this case
1718
case "$OSTYPE" in
1819
'darwin'*) BASH_IT_SED_I_PARAMETERS=(-i "")
1920
esac
@@ -80,7 +81,7 @@ function _bash_it_homebrew_check()
8081
}
8182

8283
function _make_reload_alias() {
83-
echo "source '${BASH_IT}/scripts/reloader.bash' '${1}' '${2}'"
84+
echo "source '${BASH_IT?}/scripts/reloader.bash' '${1?}' '${2?}'"
8485
}
8586

8687
# Alias for reloading aliases
@@ -443,30 +444,30 @@ _bash-it-doctor() {
443444
_param '1: BASH_IT_LOG_LEVEL argument: "errors" "warnings" "all"'
444445
_group 'lib'
445446

446-
BASH_IT_LOG_LEVEL=$1
447+
# shellcheck disable=SC2034 # expected for this case
448+
local BASH_IT_LOG_LEVEL="${1?}"
447449
_bash-it-reload
448-
unset BASH_IT_LOG_LEVEL
449450
}
450451

451452
_bash-it-doctor-all() {
452453
_about 'reloads a profile file with error, warning and debug logs'
453454
_group 'lib'
454455

455-
_bash-it-doctor "$BASH_IT_LOG_LEVEL_ALL"
456+
_bash-it-doctor "${BASH_IT_LOG_LEVEL_ALL?}"
456457
}
457458

458459
_bash-it-doctor-warnings() {
459460
_about 'reloads a profile file with error and warning logs'
460461
_group 'lib'
461462

462-
_bash-it-doctor "$BASH_IT_LOG_LEVEL_WARNING"
463+
_bash-it-doctor "${BASH_IT_LOG_LEVEL_WARNING?}"
463464
}
464465

465466
_bash-it-doctor-errors() {
466467
_about 'reloads a profile file with error logs'
467468
_group 'lib'
468469

469-
_bash-it-doctor "$BASH_IT_LOG_LEVEL_ERROR"
470+
_bash-it-doctor "${BASH_IT_LOG_LEVEL_ERROR?}"
470471
}
471472

472473
_bash-it-doctor-() {

0 commit comments

Comments
 (0)