Merge branch 'master' of https://www.github.com/danmar/cppcheck
This commit is contained in:
commit
cef06741e5
|
@ -251,7 +251,8 @@ const char * CppCheck::extraVersion()
|
||||||
unsigned int CppCheck::check(const std::string &path)
|
unsigned int CppCheck::check(const std::string &path)
|
||||||
{
|
{
|
||||||
if (mSettings.clang) {
|
if (mSettings.clang) {
|
||||||
mErrorLogger.reportOut(std::string("Checking ") + path + "...");
|
if (!mSettings.quiet)
|
||||||
|
mErrorLogger.reportOut(std::string("Checking ") + path + "...");
|
||||||
|
|
||||||
const std::string clang = Path::isCPP(path) ? "clang++" : "clang";
|
const std::string clang = Path::isCPP(path) ? "clang++" : "clang";
|
||||||
const std::string temp = mSettings.buildDir + (Path::isCPP(path) ? "/__temp__.cpp" : "/__temp__.c");
|
const std::string temp = mSettings.buildDir + (Path::isCPP(path) ? "/__temp__.cpp" : "/__temp__.c");
|
||||||
|
@ -364,8 +365,10 @@ unsigned int CppCheck::check(const ImportProject::FileSettings &fs)
|
||||||
temp.mSettings.userUndefs = fs.undefs;
|
temp.mSettings.userUndefs = fs.undefs;
|
||||||
if (fs.platformType != Settings::Unspecified)
|
if (fs.platformType != Settings::Unspecified)
|
||||||
temp.mSettings.platform(fs.platformType);
|
temp.mSettings.platform(fs.platformType);
|
||||||
if (mSettings.clang)
|
if (mSettings.clang) {
|
||||||
|
temp.mSettings.includePaths.insert(temp.mSettings.includePaths.end(), fs.systemIncludePaths.cbegin(), fs.systemIncludePaths.cend());
|
||||||
temp.check(Path::simplifyPath(fs.filename));
|
temp.check(Path::simplifyPath(fs.filename));
|
||||||
|
}
|
||||||
std::ifstream fin(fs.filename);
|
std::ifstream fin(fs.filename);
|
||||||
return temp.checkFile(Path::simplifyPath(fs.filename), fs.cfg, fin);
|
return temp.checkFile(Path::simplifyPath(fs.filename), fs.cfg, fin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,9 +255,10 @@ void ImportProject::FileSettings::parseCommand(const std::string &command)
|
||||||
defs += ';';
|
defs += ';';
|
||||||
} else if (F=='U')
|
} else if (F=='U')
|
||||||
undefs.insert(fval);
|
undefs.insert(fval);
|
||||||
else if (F=='I')
|
else if (F=='I') {
|
||||||
includePaths.push_back(fval);
|
if (std::find(includePaths.begin(), includePaths.end(), fval) == includePaths.end())
|
||||||
else if (F=='s' && fval.compare(0,2,"td") == 0) {
|
includePaths.push_back(fval);
|
||||||
|
} else if (F=='s' && fval.compare(0,2,"td") == 0) {
|
||||||
++pos;
|
++pos;
|
||||||
const std::string stdval = readUntil(command, &pos, " ");
|
const std::string stdval = readUntil(command, &pos, " ");
|
||||||
standard = stdval;
|
standard = stdval;
|
||||||
|
|
|
@ -22,7 +22,7 @@ import operator
|
||||||
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
|
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
|
||||||
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
|
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
|
||||||
# changes)
|
# changes)
|
||||||
SERVER_VERSION = "1.3.3"
|
SERVER_VERSION = "1.3.4"
|
||||||
|
|
||||||
OLD_VERSION = '1.90'
|
OLD_VERSION = '1.90'
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ def overviewReport() -> str:
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def fmt(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True) -> str:
|
def fmt(a: str, b: str, c: str = None, d: str = None, e: str = None, link: bool = True, column_width = [40, 10, 5, 7, 7, 8]) -> str:
|
||||||
column_width = [40, 10, 5, 7, 7, 8]
|
|
||||||
ret = a
|
ret = a
|
||||||
while len(ret) < column_width[0]:
|
while len(ret) < column_width[0]:
|
||||||
ret += ' '
|
ret += ' '
|
||||||
|
@ -615,12 +614,9 @@ def timeReport(resultPath: str) -> str:
|
||||||
html = '<html><head><title>Time report</title></head><body>\n'
|
html = '<html><head><title>Time report</title></head><body>\n'
|
||||||
html += '<h1>Time report</h1>\n'
|
html += '<h1>Time report</h1>\n'
|
||||||
html += '<pre>\n'
|
html += '<pre>\n'
|
||||||
column_widths = [25, 10, 10, 10]
|
column_width = [40, 10, 10, 10, 10]
|
||||||
html += '<b>'
|
html += '<b>'
|
||||||
html += 'Package '.ljust(column_widths[0]) + ' ' + \
|
html += fmt('Package', OLD_VERSION, 'Head', 'Factor', column_width=column_width)
|
||||||
OLD_VERSION.rjust(column_widths[1]) + ' ' + \
|
|
||||||
'Head'.rjust(column_widths[2]) + ' ' + \
|
|
||||||
'Factor'.rjust(column_widths[3])
|
|
||||||
html += '</b>\n'
|
html += '</b>\n'
|
||||||
|
|
||||||
total_time_base = 0.0
|
total_time_base = 0.0
|
||||||
|
@ -656,10 +652,8 @@ def timeReport(resultPath: str) -> str:
|
||||||
time_factor = time_head / time_base
|
time_factor = time_head / time_base
|
||||||
else:
|
else:
|
||||||
time_factor = 0.0
|
time_factor = 0.0
|
||||||
html += filename[len(resultPath)+1:].ljust(column_widths[0]) + ' ' + \
|
html += fmt(filename[len(resultPath)+1:], split_line[2], split_line[1],
|
||||||
split_line[2].rjust(column_widths[1]) + ' ' + \
|
'{:.2f}'.format(time_factor), column_width=column_width) + '\n'
|
||||||
split_line[1].rjust(column_widths[2]) + ' ' + \
|
|
||||||
'{:.2f}'.format(time_factor).rjust(column_widths[3]) + '\n'
|
|
||||||
break
|
break
|
||||||
|
|
||||||
html += '\n'
|
html += '\n'
|
||||||
|
@ -670,10 +664,10 @@ def timeReport(resultPath: str) -> str:
|
||||||
else:
|
else:
|
||||||
total_time_factor = 0.0
|
total_time_factor = 0.0
|
||||||
html += 'Time for all packages (not just the ones listed above):\n'
|
html += 'Time for all packages (not just the ones listed above):\n'
|
||||||
html += 'Total time: '.ljust(column_widths[0]) + ' ' + \
|
html += fmt('Total time:',
|
||||||
'{:.1f}'.format(total_time_base).rjust(column_widths[1]) + ' ' + \
|
'{:.1f}'.format(total_time_base),
|
||||||
'{:.1f}'.format(total_time_head).rjust(column_widths[2]) + ' ' + \
|
'{:.1f}'.format(total_time_head),
|
||||||
'{:.2f}'.format(total_time_factor).rjust(column_widths[3])
|
'{:.2f}'.format(total_time_factor), link=False, column_width=column_width)
|
||||||
|
|
||||||
html += '\n'
|
html += '\n'
|
||||||
html += '</pre>\n'
|
html += '</pre>\n'
|
||||||
|
|
Loading…
Reference in New Issue