style(3p/nix): Enforce braces around loops and conditionals

This change was generated with:

  fd -e cc -e hh | xargs -I{} clang-tidy {} -p ~/projects/nix-build/ \
    --checks='-*,readability-braces-around-statements' --fix \
    -fix-errors

Some manual fixes were applied because some convoluted unbraced
statements couldn't be untangled by clang-tidy.

This commit still includes invalid files, but I decided to clean them
up in a subsequent commit so that it becomes more obvious where
clang-tidy failed. Maybe this will allow for a bug-report to
clang-tidy.
This commit is contained in:
Vincent Ambo 2020-05-19 17:38:04 +01:00
parent c758de9d22
commit b490742a51
44 changed files with 661 additions and 298 deletions

View file

@ -151,7 +151,9 @@ static void opRealise(Strings opFlags, Strings opArgs) {
printMissing(ref<Store>(store), willBuild, willSubstitute, unknown,
downloadSize, narSize);
if (dryRun) return;
if (dryRun) {
return;
}
/* Build all paths at the same time to exploit parallelism. */
store->buildPaths(PathSet(paths.begin(), paths.end()), buildMode);
@ -217,7 +219,9 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs) {
static PathSet maybeUseOutputs(const Path& storePath, bool useOutput,
bool forceRealise) {
if (forceRealise) realisePath(storePath);
if (forceRealise) {
realisePath(storePath);
}
if (useOutput && isDerivation(storePath)) {
Derivation drv = store->derivationFromPath(storePath);
PathSet outputs;
@ -334,7 +338,9 @@ static void opQuery(Strings opFlags, Strings opArgs) {
i);
}
if (query == qDefault) query = qOutputs;
if (query == qDefault) {
query = qOutputs;
}
RunPager pager;