[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)

Brandon Staab via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 16:21:44 PST 2024


BrandonStaab wrote:

> I struggle with changes that encourage people to not be fully clang-formatted, I would prefer to ask why we need this feature, can we have some examples of where this would be used?

This makes it so only one line isn't formatted instead of the current solution which is 2 lines unformatted. Additionally, if you start writing code in between the unformatted region you inherit the unformatted scope. Being able to disable the formatter for only a single line means the formatter will be disabled for the shortest amount of code possible.

https://github.com/llvm/llvm-project/pull/118566


More information about the cfe-commits mailing list