ClangTools: Fix clang-tidy command-line construction

Fixes: QTCREATORBUG-26015
Change-Id: I2850e6efa5b75748599f55e8b9c96757582f5cb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-19 12:00:16 +02:00
parent e1a68f2598
commit 217dfdda7a

View File

@@ -148,18 +148,18 @@ QString ClangDiagnosticConfig::clangTidyChecksAsJson() const
return false;
};
QString optionString;
for (auto it = m_tidyChecksOptions.cbegin(); it != m_tidyChecksOptions.cend(); ++it) {
if (!checkIsEnabled(it.key()))
continue;
QString optionString;
for (auto optIt = it.value().begin(); optIt != it.value().end(); ++optIt) {
if (!optionString.isEmpty())
optionString += ',';
optionString += "{key: '" + it.key() + '.' + optIt.key()
+ "', value: '" + optIt.value() + "'}";
}
jsonString += optionString;
}
jsonString += optionString;
return jsonString += "]}";
}