[PATCH] D69764: [clang-format] Add East/West Const fixer capability

Mateusz Furdyna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 13:36:00 PDT 2021


furdyna added a comment.

> I think its worth mentioning, that my personal preference would STILL be to land this inside clang-format with default configuration of "OFF", 
> I would be interested to know how many people would be unhappy if we stated that "sorting includes" and "namespace comments" had to be removed from clang-format and into the new tool!
> So you know, I'm pushing because I'm being ask privately to land this, because I assume people want to use it, but maybe don't want to voice their opinions publicly.

I was a quiet observer up to this point, but I hope that my voice will help asses "what community wants", at least as an additional sample point. I also hope that the "community" is not only defined here as "open-source projects", but also all those poor souls working for closed-source projects ;)

I started observing this review when I was still working for another company and we were really interested in this feature. We were using clang-format extensively on several multi-milion LOC projects with total number of developers going into hundreds. "sorting includes" and "namespace comments" were one of the features that we enabled in our code bases as soon as they landed. We even quietly helped to improve include sorting here, in clang-format, squashing some bugs or extending the use-cases. We had those features enabled even with known limitations because clang-format in such large projects is not only a "simple whitespace formatting tool" - it becomes emotionless policing tool and time-saver during code reviews.

It had never crossed our minds that "sorting includes" or "namespace comments" should be separate tools. And if we did create separate tools as opposed to extending clang-format, I am 90% sure they would stay closed behind corporate doors. Another point of view is how easy it is to integrate clang-format as an existing well-known tool into various IDEs vs integrating a set of separate code-formatting programs that can have their own amusing side-effects when launched in different order.

> land this inside clang-format with default configuration of "OFF",

yes please. IMHO merging this and letting it mature over time as people use it is the best way forward vs risking various forks to be maintained by teams internally and spooking potential contributors

> I would be interested to know how many people would be unhappy

at least a few hundreds

> because I assume people want to use it

a cure for that itch, yes


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

https://reviews.llvm.org/D69764



More information about the cfe-commits mailing list