This is an archive of the discontinued LLVM Phabricator instance.

[clang-format++] Create a new variant of the clang-format tool to allow additional code mutating behaviour such as East/West Const Fixer
AbandonedPublic

Authored by MyDeveloperDay on Jul 13 2021, 3:04 PM.

Details

Summary

There has been much discussion about the relative merits of including East/West const fixer inclang-format over in D69764: [clang-format] Add Left/Right Const fixer capability on and off over the last 18 months

It seem we could not get to a concencus if this functionality should/shouldn't exist in clang-format mainly on the grounds that it broke the fundamental belief that clang-format should not modify the code (a precedent that had already been broken with SortIncludes)

As a compromise I'm suggesting a new tool which allows the introduction of such rules that can alter the code as well as format it. This allows those users who want to use this check to do so by switching to this binary.

Diff Detail

Event Timeline

MyDeveloperDay created this revision.Jul 13 2021, 3:04 PM
MyDeveloperDay requested review of this revision.Jul 13 2021, 3:04 PM
MyDeveloperDay edited the summary of this revision. (Show Details)Jul 14 2021, 12:08 AM

This could be a way, but I will also state here that I prefer adding it to plain clang-format.

This could be a way, but I will also state here that I prefer adding it to plain clang-format.

I do too, and that is my preference, Perhaps this way we can establish this as a way of showing we can reliably mutate the code with confidence. For this and a few of the other ideas collectively our clang-format community has had.

If we are able to prove it has value then I would hope and fully expect in the future to be able to at least discuss revisiting that decision, but for now I feel we have to prove its worth.

MyDeveloperDay abandoned this revision.Aug 11 2021, 9:30 AM