[cfe-dev] [llvm-dev] [RFC] Adding support for clang-format making further code modifying changes
Ben Boeckel via cfe-dev
cfe-dev at lists.llvm.org
Tue Aug 10 04:32:20 PDT 2021
On Tue, Aug 10, 2021 at 13:13:09 +0200, Manuel Klimek via cfe-dev wrote:
> clang-format is designed to run on changed lines, not to have all code be
> compliant. You can use it for the latter, but I think it's a pretty
> fundamental difference in development goals.
The problem I've seen is that the opinion of code formatted with 3 lines
of context can differ from 5 lines of context which can be still
different again given the entire file. The only reliable way we've
gotten it to work is to format the whole file every time. But we require
well-formatted code via CI processes, so that's fine (if one can afford
the "rewrite the world" every time the tool gets updated…hence why some
projects are still on version 3.8(!), others 6, some even made it to 9).
More information about the cfe-dev