--template: Removed 'clang' and renamed 'cppcheck2' to 'daca2'

This commit is contained in:
Daniel Marjamäki 2017-05-25 05:24:42 +02:00
parent dda5556ded
commit 0262020707
4 changed files with 8 additions and 11 deletions

View File

@ -996,7 +996,7 @@ void CmdLineParser::PrintHelp()
" '{file}:{line},{severity},{id},{message}' or\n" " '{file}:{line},{severity},{id},{message}' or\n"
" '{file}({line}):({severity}) {message}' or\n" " '{file}({line}):({severity}) {message}' or\n"
" '{callstack} {message}'\n" " '{callstack} {message}'\n"
" Pre-defined templates: clang, cppcheck2, gcc, vs, edit.\n" " Pre-defined templates: gcc, vs, edit.\n"
" -v, --verbose Output more detailed error information.\n" " -v, --verbose Output more detailed error information.\n"
" --version Print out version number.\n" " --version Print out version number.\n"
" --xml Write results in xml format to error stream (stderr).\n" " --xml Write results in xml format to error stream (stderr).\n"

View File

@ -169,7 +169,7 @@ protected:
ErrorPath errorPath; ErrorPath errorPath;
if (!value) { if (!value) {
errorPath.push_back(ErrorPathItem(errtok,bug)); errorPath.push_back(ErrorPathItem(errtok,bug));
} else if (_settings->verbose || _settings->xml || _settings->outputFormat == "clang" || _settings->outputFormat == "cppcheck2") { } else if (_settings->verbose || _settings->xml || _settings->outputFormat == "daca2") {
errorPath = value->errorPath; errorPath = value->errorPath;
errorPath.push_back(ErrorPathItem(errtok,bug)); errorPath.push_back(ErrorPathItem(errtok,bug));
} else { } else {

View File

@ -413,7 +413,8 @@ std::string ErrorLogger::ErrorMessage::toString(bool verbose, const std::string
return text.str(); return text.str();
} }
else if (outputFormat == "clang" || outputFormat == "cppcheck2") { else if (outputFormat == "daca2") {
// This is a clang-like output format for daca2
std::ostringstream text; std::ostringstream text;
if (_callStack.empty()) { if (_callStack.empty()) {
text << "nofile:0:0: "; text << "nofile:0:0: ";
@ -422,13 +423,9 @@ std::string ErrorLogger::ErrorMessage::toString(bool verbose, const std::string
text << loc.getfile() << ':' << loc.line << ':' << loc.col << ": "; text << loc.getfile() << ':' << loc.line << ':' << loc.col << ": ";
} }
if (outputFormat == "clang") if (_inconclusive)
text << ((_id == "syntaxError" || _id=="internalError") ? "error: " : "warning: "); text << "inconclusive ";
else { text << Severity::toString(_severity) << ": ";
if (_inconclusive)
text << "inconclusive ";
text << Severity::toString(_severity) << ": ";
}
text << (verbose ? _verboseMessage : _shortMessage) text << (verbose ? _verboseMessage : _shortMessage)
<< " [" << _id << ']'; << " [" << _id << ']';

View File

@ -152,7 +152,7 @@ def scanarchive(filepath, jobs, cpulimit):
cmd = 'cpulimit --limit=' + cpulimit cmd = 'cpulimit --limit=' + cpulimit
else: else:
cmd = 'nice --adjustment=1000' cmd = 'nice --adjustment=1000'
cmd = cmd + ' ../cppcheck-O2 -D__GCC__ --enable=style --inconclusive --error-exitcode=0 --exception-handling=stderr ' + jobs + ' --template=cppcheck2 .' cmd = cmd + ' ../cppcheck-O2 -D__GCC__ --enable=style --inconclusive --error-exitcode=0 --exception-handling=stderr ' + jobs + ' --template=daca2 .'
cmds = cmd.split() cmds = cmd.split()
p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)