Clang tidy (#2372)

* Added missing braces

* applied some clang modernize

* clarified auto pointer

* clang-tidy
This commit is contained in:
borgmanJeremy
2022-02-06 12:12:09 -06:00
committed by GitHub
parent 3c2a2f98cf
commit 0ac48f5c4b
39 changed files with 174 additions and 137 deletions

View File

@@ -44,8 +44,9 @@ QString optionsToString(const QList<CommandOption>& options,
}
// check the length of the arguments
for (auto const& arg : arguments) {
if (arg.name().length() > size)
if (arg.name().length() > size) {
size = arg.name().length();
}
}
// generate the text
QString result;
@@ -172,8 +173,9 @@ bool CommandLineParser::processOptions(const QStringList& args,
ok = option.checkValue(valueStr);
if (!ok) {
QString msg = option.errorMsg();
if (!msg.endsWith(QLatin1String(".")))
if (!msg.endsWith(QLatin1String("."))) {
msg += QLatin1String(".");
}
err << msg;
return ok;
}
@@ -338,11 +340,13 @@ void CommandLineParser::printHelp(QStringList args, const Node* node)
// add command options and subarguments
QList<CommandArgument> subArgs;
for (const Node& n : node->subNodes)
for (const Node& n : node->subNodes) {
subArgs.append(n.argument);
}
auto modifiedOptions = node->options;
if (m_withHelp)
if (m_withHelp) {
modifiedOptions << helpOption;
}
if (m_withVersion && node == &m_parseTree) {
modifiedOptions << versionOption;
}