[PATCH] D145435: Choose style (file) from within code for use in IDEs

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 21 03:06:55 PDT 2023


MyDeveloperDay added a comment.

I'm kind of with @owenpan on this one, I don't hate the feature, but I think it goes against the sprit of "clang-format", we are only the custodians here (for now), I don't want to break too much the ethos of the original authors which I think was to help end the code formatting style wars, I'm not sure that this isn't helping to proliferate them rather than stamping them out.

> That is a good point. It's probably an argument for restricting the search for that comment to the first N lines of the file

I think we'll get complaints it doesn't work at line N+1 because their copyright notice and changelog is 300 lines long..

or that they can't switch the style mid file and then back again, in the way clang-format on/off works

> Teams not (fully) agreeing on a common style, with different people using different styles

Well I hear this, I totally I understand, but this is a team problem not a clang-format problem, it really means your team isn't aligned to use clang-format, get buy in from senior management, make it a commit hook failure, or sit down as a team a decide what's best.

My advice to your "different people" (and I've done this on a large project) is to just do it for the whole project. Tell the team to bite the bullet, adopt the new style as their own and move on.


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

https://reviews.llvm.org/D145435



More information about the cfe-commits mailing list