@@ -1010,10 +1010,7 @@ QString MainWindow::loadAddon(Settings &settings, const QString &filesDir, const
1010
1010
if (!misraFile.isEmpty ()) {
1011
1011
QString arg;
1012
1012
picojson::array arr;
1013
- if (misraFile.endsWith (" .pdf" , Qt::CaseInsensitive))
1014
- arg = " --misra-pdf=" + misraFile;
1015
- else
1016
- arg = " --rule-texts=" + misraFile;
1013
+ arg = " --rule-texts=" + misraFile;
1017
1014
arr.emplace_back (arg.toStdString ());
1018
1015
obj[" args" ] = picojson::value (arr);
1019
1016
}
@@ -1039,6 +1036,7 @@ bool MainWindow::getCppcheckSettings(Settings& settings, Suppressions& supprs)
1039
1036
Settings::terminate (true );
1040
1037
1041
1038
settings.exename = QCoreApplication::applicationFilePath ().toStdString ();
1039
+ settings.templateFormat = " {file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]" ;
1042
1040
1043
1041
// default to --check-level=normal for GUI for now
1044
1042
settings.setCheckLevel (Settings::CheckLevel::normal );
@@ -1157,6 +1155,8 @@ bool MainWindow::getCppcheckSettings(Settings& settings, Suppressions& supprs)
1157
1155
settings.checkUnknownFunctionReturn .insert (s.toStdString ());
1158
1156
1159
1157
for (const QString& addon : mProjectFile ->getAddons ()) {
1158
+ if (isCppcheckPremium () && addon == " misra" )
1159
+ continue ;
1160
1160
const QString addonError = loadAddon (settings, filesDir, pythonCmd, addon);
1161
1161
if (!addonError.isEmpty ()) {
1162
1162
QMessageBox::critical (this , tr (" Error" ), tr (" %1\n\n Analysis is aborted." ).arg (addonError));
@@ -1172,7 +1172,7 @@ bool MainWindow::getCppcheckSettings(Settings& settings, Suppressions& supprs)
1172
1172
premiumArgs += " --cert-c-int-precision=" + QString::number (mProjectFile ->getCertIntPrecision ());
1173
1173
for (const QString& c: mProjectFile ->getCodingStandards ())
1174
1174
premiumArgs += " --" + c;
1175
- if (!premiumArgs.contains (" misra" ) && mProjectFile ->getAddons ().contains (" misra" ))
1175
+ if (!premiumArgs.contains (" -- misra-c- " ) && mProjectFile ->getAddons ().contains (" misra" ))
1176
1176
premiumArgs += " --misra-c-2012" ;
1177
1177
settings.premiumArgs = premiumArgs.mid (1 ).toStdString ();
1178
1178
settings.setMisraRuleTexts (CheckThread::executeCommand);
0 commit comments