diff --git a/.travis.yml b/.travis.yml index a5a0fd789..f002fa7d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,6 +73,9 @@ script: # check gui with qt settings - ${CPPCHECK} --library=qt --error-exitcode=1 -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml/ -Icli --enable=style,performance,portability,warning,internal --exception-handling -j 2 gui --suppressions-list=.travis_suppressions -igui/test |& tee --append /tmp/cppcheck.cppcheck - sh -c "! grep '^\[' /tmp/cppcheck.cppcheck" +# check naming conventions + - ${CPPCHECK} --dump -q lib + - python addons/naming.py --private-member-variable='m[A-Z].*' lib/*.cpp.dump # run extra tests - tools/generate_and_run_more_tests.sh # Validate XML diff --git a/addons/naming.py b/addons/naming.py index 6b841bae9..512a492ce 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -23,7 +23,11 @@ for arg in sys.argv[1:]: RE_FUNCTIONNAME = arg[11:] +FoundError = False + def reportError(token, severity, msg): + global FoundError + FoundError = True sys.stderr.write( '[' + token.file + ':' + str(token.linenr) + '] (' + severity + ') naming.py: ' + msg + '\n') @@ -56,3 +60,8 @@ for arg in sys.argv[1:]: if not res: reportError( scope.bodyStart, 'style', 'Function ' + scope.className + ' violates naming convention') + +if FoundError: + print('FoundError') + sys.exit(1) +