Skip to content

Commit 2cfaa41

Browse files
committed
add "Dir " prefix to misra directives guideline strings
1 parent 99ed1e2 commit 2cfaa41

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/errorlogger.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,6 @@ std::string getGuideline(const std::string &errId, ReportType reportType,
10431043
case ReportType::misraC2025:
10441044
if (errId.rfind("misra-c20", 0) == 0 || errId.rfind("premium-misra-c-20", 0) == 0)
10451045
guideline = errId.substr(errId.rfind('-') + 1);
1046-
if (errId.find("-dir-") != std::string::npos)
1047-
guideline = "Dir " + guideline;
10481046
break;
10491047
case ReportType::misraCpp2008:
10501048
if (errId.rfind("misra-cpp-2008-", 0) == 0)
@@ -1058,8 +1056,11 @@ std::string getGuideline(const std::string &errId, ReportType reportType,
10581056
break;
10591057
}
10601058

1061-
if (!guideline.empty())
1059+
if (!guideline.empty()) {
1060+
if (errId.find("-dir-") != std::string::npos)
1061+
guideline = "Dir " + guideline;
10621062
return guideline;
1063+
}
10631064

10641065
auto it = guidelineMapping.find(errId);
10651066

0 commit comments

Comments
 (0)