1
0
Fork 0
mirror of synced 2024-11-04 17:08:56 -05:00

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')
def shellcheck_version():
"""Version of shellcheck supported"""
return '0.8.0'
return '0.9.0'
@pytest.fixture(scope='session')

14
yadm
View file

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