File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -561,20 +561,20 @@ void StdLogger::reportErr(const ErrorMessage &msg)
561561 mGuidelineMapping , msgCopy.severity );
562562 msgCopy.classification = getClassification (msgCopy.guideline , mSettings .reportType );
563563
564+ // TODO: there should be no need for verbose and default messages here
565+ const std::string msgStr =
566+ msgCopy.toString (mSettings .verbose , mSettings .templateFormat , mSettings .templateLocation );
567+
568+ // Alert only about unique errors
569+ if (!mSettings .emitDuplicates && !mShownErrors .insert (msgStr).second )
570+ return ;
571+
564572 if (mSettings .outputFormat == Settings::OutputFormat::sarif) {
565573 mSarifReport .addFinding (std::move (msgCopy));
574+ } else if (mSettings .outputFormat == Settings::OutputFormat::xml) {
575+ reportErr (msgCopy.toXML ());
566576 } else {
567- // TODO: there should be no need for verbose and default messages here
568- const std::string msgStr = msgCopy.toString (mSettings .verbose , mSettings .templateFormat , mSettings .templateLocation );
569-
570- // Alert only about unique errors
571- if (!mSettings .emitDuplicates && !mShownErrors .insert (msgStr).second )
572- return ;
573-
574- if (mSettings .outputFormat == Settings::OutputFormat::xml)
575- reportErr (msgCopy.toXML ());
576- else
577- reportErr (msgStr);
577+ reportErr (msgStr);
578578 }
579579}
580580
You can’t perform that action at this time.
0 commit comments