From fd1f2a0d234badf7f8cfd79cbf830df128c5a352 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Sun, 5 Apr 2026 00:16:57 +0400 Subject: [PATCH] Lint files --- bash_it.sh | 2 +- completion/available/bash-it.completion.bash | 2 +- .../available/dmidecode.completion.bash | 2 +- .../available/docker-compose.completion.bash | 2 +- completion/available/gem.completion.bash | 2 +- .../available/notify-send.completion.bash | 2 +- completion/available/salt.completion.bash | 20 +++++++++---------- completion/available/sdkman.completion.bash | 8 ++++---- .../available/test_kitchen.completion.bash | 2 +- completion/available/tmux.completion.bash | 2 +- completion/available/vagrant.completion.bash | 8 ++++---- .../available/virtualbox.completion.bash | 4 ++-- completion/available/vuejs.completion.bash | 2 +- plugins/available/aws.plugin.bash | 2 +- plugins/available/z_autoenv.plugin.bash | 2 +- .../nwinkler_random_colors.theme.bash | 8 ++++---- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 8131e560fe..70020db20d 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -14,7 +14,7 @@ BASH_IT_LOG_PREFIX="core: main: " : "${BASH_IT:=${BASH_SOURCE%/*}}" : "${BASH_IT_CUSTOM:=${BASH_IT}/custom}" : "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM}/themes"}" -: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}}" +: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]}-1]}}" # Load composure first, so we support function metadata # shellcheck source-path=SCRIPTDIR/vendor/github.com/erichs/composure diff --git a/completion/available/bash-it.completion.bash b/completion/available/bash-it.completion.bash index c618eb7002..bae7e7414e 100644 --- a/completion/available/bash-it.completion.bash +++ b/completion/available/bash-it.completion.bash @@ -15,7 +15,7 @@ function _bash-it() { local cur prev verb file_type candidates suffix COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" verb="${COMP_WORDS[1]}" file_type="${COMP_WORDS[2]:-}" candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'preview' 'profile' 'doctor' 'search' 'show' 'update' 'version') diff --git a/completion/available/dmidecode.completion.bash b/completion/available/dmidecode.completion.bash index eacfee81fe..3d88b3c3cf 100644 --- a/completion/available/dmidecode.completion.bash +++ b/completion/available/dmidecode.completion.bash @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary dmidecode || : _bash-it-completion-helper-sufficient dmidecode || return function _dmidecode() { - local prev="${COMP_WORDS[COMP_CWORD - 1]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in -s | --string | -t | --type) diff --git a/completion/available/docker-compose.completion.bash b/completion/available/docker-compose.completion.bash index f0755f36e5..86ff1433c3 100644 --- a/completion/available/docker-compose.completion.bash +++ b/completion/available/docker-compose.completion.bash @@ -85,7 +85,7 @@ __docker_compose_map_key_of_current_option() { key=${cur%=*} glob_pos=$((cword - 1)) elif [ "$prev" = "=" ]; then - key=${words[$cword - 2]} # key=value case + key=${words[$cword-2]} # key=value case glob_pos=$((cword - 3)) else return diff --git a/completion/available/gem.completion.bash b/completion/available/gem.completion.bash index c3e43d529d..b3d973b30d 100644 --- a/completion/available/gem.completion.bash +++ b/completion/available/gem.completion.bash @@ -6,7 +6,7 @@ url "https://rubygems.org/" __gem_completion() { local cur=${COMP_WORDS[COMP_CWORD]} - local prev=${COMP_WORDS[COMP_CWORD - 1]} + local prev=${COMP_WORDS[COMP_CWORD-1]} case $prev in install) # list the remote gems and add to completion diff --git a/completion/available/notify-send.completion.bash b/completion/available/notify-send.completion.bash index 4745b2abee..2acf5a5698 100644 --- a/completion/available/notify-send.completion.bash +++ b/completion/available/notify-send.completion.bash @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary notify-send || : _bash-it-completion-helper-sufficient notify-send || return function _notify-send() { - local prev="${COMP_WORDS[COMP_CWORD - 1]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in -u | --urgency) diff --git a/completion/available/salt.completion.bash b/completion/available/salt.completion.bash index 19f92dae26..d706189e93 100644 --- a/completion/available/salt.completion.bash +++ b/completion/available/salt.completion.bash @@ -49,12 +49,12 @@ _salt() { local cur prev opts _salt_grains _salt_coms pprev ppprev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" if [ "${COMP_CWORD}" -gt 2 ]; then - pprev="${COMP_WORDS[COMP_CWORD - 2]}" + pprev="${COMP_WORDS[COMP_CWORD-2]}" fi if [ "${COMP_CWORD}" -gt 3 ]; then - ppprev="${COMP_WORDS[COMP_CWORD - 3]}" + ppprev="${COMP_WORDS[COMP_CWORD-3]}" fi opts="-h --help -d --doc --documentation --version --versions-report -c \ @@ -145,7 +145,7 @@ _saltkey() { local cur prev opts prev pprev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" opts="-c --config-dir= -h --help --version --versions-report -q --quiet \ -y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \ -l --list= -L --list-all -a --accept= -A --accept-all \ @@ -154,10 +154,10 @@ _saltkey() { --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=highstate --out=key --out=txt --no-color --out-indent= " if [ "${COMP_CWORD}" -gt 2 ]; then - pprev="${COMP_WORDS[COMP_CWORD - 2]}" + pprev="${COMP_WORDS[COMP_CWORD-2]}" fi if [ "${COMP_CWORD}" -gt 3 ]; then - ppprev="${COMP_WORDS[COMP_CWORD - 3]}" + ppprev="${COMP_WORDS[COMP_CWORD-3]}" fi if [[ "${cur}" == -* ]]; then COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) @@ -232,16 +232,16 @@ _saltcall() { local cur prev opts _salt_coms pprev ppprev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" opts="-h --help -d --doc --documentation --version --versions-report \ -m --module-dirs= -g --grains --return= --local -c --config-dir= -l --log-level= \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=highstate --out=key --out=txt --no-color --out-indent= " if [ "${COMP_CWORD}" -gt 2 ]; then - pprev="${COMP_WORDS[COMP_CWORD - 2]}" + pprev="${COMP_WORDS[COMP_CWORD-2]}" fi if [ "${COMP_CWORD}" -gt 3 ]; then - ppprev="${COMP_WORDS[COMP_CWORD - 3]}" + ppprev="${COMP_WORDS[COMP_CWORD-3]}" fi if [[ "${cur}" == -* ]]; then COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) @@ -284,7 +284,7 @@ _saltcp() { local cur prev opts prefpart helper filt pprev ppprev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" opts="-t --timeout= -s --static -b --batch= --batch-size= \ -h --help --version --versions-report -c --config-dir= \ -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ diff --git a/completion/available/sdkman.completion.bash b/completion/available/sdkman.completion.bash index 09f6fe8620..a72724d256 100644 --- a/completion/available/sdkman.completion.bash +++ b/completion/available/sdkman.completion.bash @@ -11,7 +11,7 @@ function _sdkman_complete() { if [ "$COMP_CWORD" -eq 1 ]; then while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "install uninstall rm list ls use default home env current upgrade ug version broadcast help offline selfupdate update flush" -- "${COMP_WORDS[COMP_CWORD]}") elif [ "$COMP_CWORD" -eq 2 ]; then - case "${COMP_WORDS[COMP_CWORD - 1]}" in + case "${COMP_WORDS[COMP_CWORD-1]}" in "install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug") CANDIDATES="${SDKMAN_CANDIDATES_CSV//,/${IFS:0:1}}" while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}") @@ -32,13 +32,13 @@ function _sdkman_complete() { esac elif [ "$COMP_CWORD" -eq 3 ]; then - case "${COMP_WORDS[COMP_CWORD - 2]}" in + case "${COMP_WORDS[COMP_CWORD-2]}" in "uninstall" | "rm" | "use" | "u" | "default" | "d" | "home" | "h") - _sdkman_candidate_local_versions "${COMP_WORDS[COMP_CWORD - 1]}" + _sdkman_candidate_local_versions "${COMP_WORDS[COMP_CWORD-1]}" while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}") ;; "install" | "i") - _sdkman_candidate_all_versions "${COMP_WORDS[COMP_CWORD - 1]}" + _sdkman_candidate_all_versions "${COMP_WORDS[COMP_CWORD-1]}" while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}") ;; *) ;; diff --git a/completion/available/test_kitchen.completion.bash b/completion/available/test_kitchen.completion.bash index c53c303a5f..6cc3991903 100644 --- a/completion/available/test_kitchen.completion.bash +++ b/completion/available/test_kitchen.completion.bash @@ -11,7 +11,7 @@ __kitchen_instance_list() { __kitchen_options() { cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" COMPREPLY=() case $prev in diff --git a/completion/available/tmux.completion.bash b/completion/available/tmux.completion.bash index f3c68f53d5..c7fdca1f62 100644 --- a/completion/available/tmux.completion.bash +++ b/completion/available/tmux.completion.bash @@ -66,7 +66,7 @@ _tmux() { local i cmd cmd_index option option_index COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" if [[ "${prev}" == -f ]]; then _tmux_filedir diff --git a/completion/available/vagrant.completion.bash b/completion/available/vagrant.completion.bash index b5e8019581..bde33fbcb3 100644 --- a/completion/available/vagrant.completion.bash +++ b/completion/available/vagrant.completion.bash @@ -56,7 +56,7 @@ __vagrantinvestigate() { _vagrant() { cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" commands="box cloud destroy global-status halt help hostmanager init login package plugin port powershell provision push rdp reload resume scp snapshot ssh ssh-config status suspend up upload validate vbguest version winrm winrm-config" if ((COMP_CWORD == 1)); then @@ -123,7 +123,7 @@ _vagrant() { fi if ((COMP_CWORD == 3)); then - action="${COMP_WORDS[COMP_CWORD - 2]}" + action="${COMP_WORDS[COMP_CWORD-2]}" case "$action" in "up") if [ "$prev" == "--no-provision" ]; then @@ -155,8 +155,8 @@ _vagrant() { fi if ((COMP_CWORD == 4)); then - action="${COMP_WORDS[COMP_CWORD - 3]}" - prev="${COMP_WORDS[COMP_CWORD - 2]}" + action="${COMP_WORDS[COMP_CWORD-3]}" + prev="${COMP_WORDS[COMP_CWORD-2]}" case "$action" in "snapshot") if [ "$prev" == "restore" ]; then diff --git a/completion/available/virtualbox.completion.bash b/completion/available/virtualbox.completion.bash index d6bfb5a948..afab27d9d4 100644 --- a/completion/available/virtualbox.completion.bash +++ b/completion/available/virtualbox.completion.bash @@ -155,7 +155,7 @@ _vboxmanage() { local cur opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" # echo "cur: |$cur|" # echo "prev: |$prev|" @@ -206,7 +206,7 @@ _vboxmanage() { for VM in $(__vboxmanage_list_vms); do if [ "$VM" == "$prev" ]; then - pprev=${COMP_WORDS[COMP_CWORD - 2]} + pprev=${COMP_WORDS[COMP_CWORD-2]} # echo "previous: $pprev" case $pprev in startvm) diff --git a/completion/available/vuejs.completion.bash b/completion/available/vuejs.completion.bash index b7ee31980e..88eea39cec 100644 --- a/completion/available/vuejs.completion.bash +++ b/completion/available/vuejs.completion.bash @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary vue || : _bash-it-completion-helper-sufficient vue || return function _vuejs() { - local prev="${COMP_WORDS[COMP_CWORD - 1]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" case $prev in create) diff --git a/plugins/available/aws.plugin.bash b/plugins/available/aws.plugin.bash index 60656b336f..d7a75a5b04 100644 --- a/plugins/available/aws.plugin.bash +++ b/plugins/available/aws.plugin.bash @@ -99,7 +99,7 @@ function __awskeys_comp { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD - 1]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" opts="help list show export unset" diff --git a/plugins/available/z_autoenv.plugin.bash b/plugins/available/z_autoenv.plugin.bash index 83d9139584..7474f9fd0f 100644 --- a/plugins/available/z_autoenv.plugin.bash +++ b/plugins/available/z_autoenv.plugin.bash @@ -29,7 +29,7 @@ autoenv_init() { _file=${#_files[@]} while ((_file > 0)); do #shellcheck disable=SC1090 - source "${_files[_file - __array_offset]}" + source "${_files[_file-__array_offset]}" : $((_file -= 1)) done } diff --git a/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash b/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash index 8862400fd8..69356456cc 100644 --- a/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash +++ b/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash @@ -54,11 +54,11 @@ function randomize_nwinkler { #$underline_orange #) - USERNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]} - HOSTNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]} - TIME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]} + USERNAME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]} + HOSTNAME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]} + TIME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]} THEME_CLOCK_COLOR=$TIME_COLOR - PATH_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]} + PATH_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]} echo "$USERNAME_COLOR,$HOSTNAME_COLOR,$TIME_COLOR,$PATH_COLOR," > "$RANDOM_COLOR_FILE" }