.travis.yml: Check python syntax (version 2 and 3) (#1694)

As suggested by rikardfalkeborn here:
https://github.com/danmar/cppcheck/pull/1679#issuecomment-465927692
By compiling python scripts the syntax can be checked.
There are two compilations, one for Python 2 and one for Python 3 for
most scripts to make sure at least the syntax is valid for both
versions.
This commit is contained in:
Sebastian 2019-02-25 16:11:14 +01:00 committed by GitHub
parent 587474e3b0
commit b2bb8daaca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -73,6 +73,14 @@ matrix:
# check --dump
- ${CPPCHECK} test/testpreprocessor.cpp --dump
- xmllint --noout test/testpreprocessor.cpp.dump
# check python syntax by compiling all addon scripts
- python -m compileall ./addons
- python3 -m compileall ./addons
# check python syntax by compiling some selected scripts
- python -m py_compile ./tools/donate-cpu.py
- python3 -m py_compile ./tools/donate-cpu.py
- python -m py_compile ./tools/donate-cpu-server.py
# donate-cpu-server.py is currently not Python 3 compatible
# check addons/misra.py
- cd addons/test
- ${CPPCHECK} --dump misc-test.cpp