# HG changeset patch # User Andrey Skvortsov # Date 1538556424 -10800 # Node ID 290b77b721230e437ac7118c2dce228dcced1c31 # Parent c081dabc0f63b9fdfbb1b0f6f1e41dad93dbbd04 Add python3 syntax checking to CI diff -r c081dabc0f63 -r 290b77b72123 tests/tools/check_source.sh --- a/tests/tools/check_source.sh Wed Oct 03 11:44:57 2018 +0300 +++ b/tests/tools/check_source.sh Wed Oct 03 11:47:04 2018 +0300 @@ -52,6 +52,32 @@ echo "" } + +python3_compile_checks() +{ + echo "Syntax checking using python3 ..." + python3 --version + + # remove compiled Python files + find . -name '*.pyc' -exec rm -f {} \; + + for i in $py_files; do + # echo $i + python3 -m py_compile $i + if [ $? -ne 0 ]; then + echo "Syntax error in $i" + set_exit_error + fi + done + + # remove compiled Python files + find . -name '*.pyc' -exec rm -f {} \; + + echo "DONE" + echo "" +} + + # pep8 was renamed to pycodestyle # detect existed version pep8_detect() @@ -390,6 +416,7 @@ main() { get_files_to_check $@ + python3_compile_checks compile_checks pep8_checks_default # pep8_checks_selected