Don't add suppressed errors to plist output (#4038)

This commit is contained in:
Falital 2022-04-26 17:39:39 +02:00 committed by GitHub
parent 0dc3cb6eba
commit e8a96932e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1542,7 +1542,9 @@ void CppCheck::reportErr(const ErrorMessage &msg)
mErrorList.push_back(errmsg); mErrorList.push_back(errmsg);
mErrorLogger.reportErr(msg); mErrorLogger.reportErr(msg);
if (!mSettings.plistOutput.empty() && plistFile.is_open()) { // check if plistOutput should be populated and the current output file is open and the error is not suppressed
if (!mSettings.plistOutput.empty() && plistFile.is_open() && !mSettings.nomsg.isSuppressed(errorMessage)) {
// add error to plist output file
plistFile << ErrorLogger::plistData(msg); plistFile << ErrorLogger::plistData(msg);
} }
} }