Browse Source

Fix bashate warnings

Three ((value++)) lines are generating this bashate warning:
E043: Arithmetic compound has inconsistent return semantics

This will now be an error when running pep8 checks.

Trivialfix

Change-Id: If7a63e550d5d27fe6716cc63c85426cd2250732f
changes/60/442660/2
Brian Haley 4 years ago
parent
commit
a0552e75e3
  1. 6
      tools/check_unit_test_structure.sh
  2. 3
      tox.ini

6
tools/check_unit_test_structure.sh

@ -42,14 +42,14 @@ for test_file in ${test_files[@]}; do
if [ ! -f "$filename" ] && [ ! -d "$package_dir" ]; then
for ignore_regex in ${ignore_regexes[@]}; do
if [[ "$relative_path" =~ $ignore_regex ]]; then
((ignore_count++))
ignore_count=$((ignore_count + 1))
continue 2
fi
done
echo "Unexpected test file: $base_test_path/$relative_path"
((error_count++))
error_count=$((error_count + 1))
fi
((total_count++))
total_count=$((total_count + 1))
done
if [ "$ignore_count" -ne 0 ]; then

3
tox.ini

@ -138,7 +138,8 @@ commands = bash -c "find {toxinidir} \
# E005 file does not begin with #! or have a .sh prefix
# E006 check for lines longer than 79 columns
# E042 local declaration hides errors
-print0 | xargs -0 bashate -v -iE006 -eE005,E042"
# E043 Arithmetic compound has inconsistent return semantics
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
[testenv:genconfig]
commands = {toxinidir}/tools/generate_config_file_samples.sh

Loading…
Cancel
Save