Belle II Software  release-08-01-10
online_book_cppcheck.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 Perform code quality cppchecks for every commit to the online_book package.
13 """
14 
15 import re
16 from b2test_utils import check_error_free
17 
18 if __name__ == "__main__":
19  # Ignore the nofile .. [missingInclude] that is always at the end of cppcheck
20  ignoreme = 'Cppcheck cannot find all the include files'
21  # Ignore the unmatched suppression warning unusedFunction
22  ignoreUnmatchedUnusedFunction = 'Unmatched suppression: unusedFunction'
23  # Ignore the unmatched suppression warning useStlAlgorithm
24  ignoreUnmatchedUseStlAlgorithm = 'Unmatched suppression: useStlAlgorithm'
25  check_error_free("b2code-cppcheck", "cppcheck", "online_book",
26  lambda x:
27  re.findall(ignoreme, x) or
28  re.findall(ignoreUnmatchedUnusedFunction, x) or
29  re.findall(ignoreUnmatchedUseStlAlgorithm, x) or
30  x == "'")