[PATCH] D132256: [clang-format] Add DefinitionBlockSpacing option

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 12:20:04 PDT 2022


HazardyKnusperkeks added a comment.

In D132256#3740714 <https://reviews.llvm.org/D132256#3740714>, @alecto wrote:

> If possible I would like to error out if MaxEmptyLinesToKeep < DefinitionBlockSpacing, because that case is probably a mistake on the part of the user, and a failure would be better than clang-format silently doing something unexpected, but I'm not sure where to put the logic for failure.
>
> Where does clang-format handle style/input validation, and what method does it use for handling errors? (Does it rely on exceptions, or returning a "failure" state of some kind?)

Take a look at https://github.com/llvm/llvm-project/blob/2b8f722e630d0fdf1ca267361866a27c8d4c9387/clang/lib/Format/Format.cpp#L1696


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132256/new/

https://reviews.llvm.org/D132256



More information about the cfe-commits mailing list