Changes for new shellcheck compliance

This commit is contained in:
Tim Byrne 2023-07-09 10:32:52 -05:00
parent c8acf77e04
commit f9e0368385
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
2 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ def pytest_addoption(parser):
@pytest.fixture(scope='session') @pytest.fixture(scope='session')
def shellcheck_version(): def shellcheck_version():
"""Version of shellcheck supported""" """Version of shellcheck supported"""
return '0.8.0' return '0.9.0'
@pytest.fixture(scope='session') @pytest.fixture(scope='session')

14
yadm
View File

@ -289,18 +289,18 @@ function record_score() {
# increase the index of any existing alt_template_cmds # increase the index of any existing alt_template_cmds
new_cmds=() new_cmds=()
for cmd_index in "${!alt_template_cmds[@]}"; do for cmd_index in "${!alt_template_cmds[@]}"; do
new_cmds[$((cmd_index+1))]="${alt_template_cmds[$cmd_index]}" new_cmds[cmd_index+1]="${alt_template_cmds[$cmd_index]}"
done done
alt_template_cmds=() alt_template_cmds=()
for cmd_index in "${!new_cmds[@]}"; do for cmd_index in "${!new_cmds[@]}"; do
alt_template_cmds[$cmd_index]="${new_cmds[$cmd_index]}" alt_template_cmds[cmd_index]="${new_cmds[$cmd_index]}"
done done
else else
alt_targets+=("$tgt") alt_targets+=("$tgt")
# set index to the last index (newly created one) # set index to the last index (newly created one)
for index in "${!alt_targets[@]}"; do :; done for index in "${!alt_targets[@]}"; do :; done
# and set its initial score to zero # and set its initial score to zero
alt_scores[$index]=0 alt_scores[index]=0
fi fi
fi fi
@ -309,8 +309,8 @@ function record_score() {
# record higher scoring sources # record higher scoring sources
if [ "$score" -gt "${alt_scores[$index]}" ]; then if [ "$score" -gt "${alt_scores[$index]}" ]; then
alt_scores[$index]="$score" alt_scores[index]="$score"
alt_sources[$index]="$src" alt_sources[index]="$src"
fi fi
} }
@ -336,8 +336,8 @@ function record_template() {
fi fi
# record the template command, last one wins # record the template command, last one wins
alt_template_cmds[$index]="$cmd" alt_template_cmds[index]="$cmd"
alt_sources[$index]="$src" alt_sources[index]="$src"
} }