static code analysis(cppcheck).
()
| 92 | |
| 93 | @cli.command() |
| 94 | def check(): |
| 95 | """ |
| 96 | static code analysis(cppcheck). |
| 97 | """ |
| 98 | format_ignore.init_logger() |
| 99 | # get modified files list |
| 100 | checkout = format_ignore.CheckOut() |
| 101 | file_list = checkout.get_new_file() |
| 102 | if file_list is None: |
| 103 | logging.error("checkout files fail") |
| 104 | sys.exit(1) |
| 105 | |
| 106 | # use cppcheck |
| 107 | cpp_check = CPPCheck(file_list) |
| 108 | cpp_check_result = cpp_check.check() |
| 109 | |
| 110 | if not cpp_check_result: |
| 111 | logging.error("static code analysis(cppcheck) fail.") |
| 112 | sys.exit(1) |
| 113 | logging.info("check success.") |
| 114 | sys.exit(0) |
| 115 | |
| 116 | |
| 117 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected