[PATCH] D93844: [clang-format] Add possibility to be based on parent directory
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 2 05:32:42 PST 2021
njames93 added a comment.
As a follow up it may be wise to pass a diag handler to parseConfiguration as when we parse it a second time, we probably want to disregard any warnings (like unknown key) detected as they will have been printed on the first pass.
================
Comment at: clang/lib/Format/Format.cpp:3011-3017
+ std::for_each(
+ ChildFormatTextToApply.rbegin(), ChildFormatTextToApply.rend(),
+ [&Style, AllowUnknownOptions](const auto &Ptr) {
+ auto Ec = parseConfiguration(*Ptr, &Style, AllowUnknownOptions);
+ // It was already correctly parsed.
+ assert(!Ec);
+ });
----------------
Nit: just use a for loop over a lambda.
================
Comment at: clang/lib/Format/Format.cpp:3051
+ // It was already correctly parsed.
+ assert(!Ec);
+ }
----------------
Nit: Add a void cast to silence unused warnings in release builds.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93844/new/
https://reviews.llvm.org/D93844
More information about the cfe-commits
mailing list