style(3p/nix): Add braces around single-line conditionals

These were not caught by the previous clang-tidy invocation, but were
instead sorted out using amber[0] as such:

    ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }'

[0]: https://github.com/dalance/amber
This commit is contained in:
Vincent Ambo 2020-05-19 18:55:58 +01:00
parent c6a31838cd
commit 867055133d
97 changed files with 2223 additions and 753 deletions

View file

@ -19,14 +19,18 @@ static Strings parseAttrPath(const string& s) {
if (i == s.end())
throw Error(format("missing closing quote in selection path '%1%'") %
s);
if (*i == '"') break;
if (*i == '"') {
break;
}
cur.push_back(*i++);
}
} else
cur.push_back(*i);
++i;
}
if (!cur.empty()) res.push_back(cur);
if (!cur.empty()) {
res.push_back(cur);
}
return res;
}
@ -44,7 +48,9 @@ Value* findAlongAttrPath(EvalState& state, const string& attrPath,
/* Is i an index (integer) or a normal attribute name? */
enum { apAttr, apIndex } apType = apAttr;
unsigned int attrIndex;
if (string2Int(attr, attrIndex)) apType = apIndex;
if (string2Int(attr, attrIndex)) {
apType = apIndex;
}
/* Evaluate the expression. */
Value* vNew = state.allocValue();