[cfe-dev] [llvm-dev] [RFC] Adding support for clang-format making further code modifying changes

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 10 06:40:44 PDT 2021


On Tue, 10 Aug 2021 at 13:35, MyDeveloper Day <mydeveloperday at gmail.com>
wrote:

> FWIW, I run a multi million line project, we run the bleeding edge, last
> released version, each release of Clang-Format I have maybe 10-20 files to
> change. If I left it 5 or so releases I'm sure the impact would seem
> greater.
>

That's not the only problem.

If people have different versions of clang-format installed, and you have
format as part of the workflow, committing will often include rewrites of
the same things.

In our case, if our formatting doesn't match the CI formatting the PR is
rejected. Even just running on the changed lines, you get different results.

The only solution is to force people to install clang-format-X locally.

You can say "clang-format wasn't designed for that", but that's what it's
used for in many places and its user base is now massive.

You wanted to gather opinions of what clang-format could/should do, well,
those are common use cases.

Adding more breaking changes without safety pins will make usage reduce,
not increase.

IMHO, if you want more people to use you need to increase safety first,
then add breaking changes with visible warnings (naming, flags, comments,
whatever), and make sure breaking changes are not on by default.

For example, if clang-format starts breaking code without notice, we'll
have to stick to -9 forever, or remove it as a dependency for PRs
altogether.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210810/9ad66f4e/attachment.html>


More information about the cfe-dev mailing list