This is an archive of the discontinued LLVM Phabricator instance.

clang-format: `SpaceAfterTemplate` and `SpacesInBraces` options
AbandonedPublic

Authored by MyDeveloperDay on Apr 13 2016, 11:12 AM.

Details

Summary

This patch adds two new spacing options.

SpaceAfterTemplate inserts a space between the template keyword and the opening chevron.

SpacesInBraces inserts spaces in short and empty brace blocks.

Patch by cameron314.

Diff Detail

Event Timeline

mxbOctasic retitled this revision from to clang-format: `SpaceAfterTemplate` and `SpacesInBraces` options.
mxbOctasic updated this object.
mxbOctasic added a reviewer: djasper.
mxbOctasic added subscribers: cameron314, cfe-commits.
djasper edited edge metadata.Apr 13 2016, 12:00 PM

Please read http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options.

The "template" option was discussed multiple times and I remain convinced that the costs outweigh the benefit here.

For the other option:

  • Can you make statements wrt. to the requirements made on that page.
  • This is pulling many things into one option that don't belong together. For braced lists, there is already the Cpp11BracedListStyle option which does the same thing (but also something else). We need a clear strategy for that option.
  • Similar to the template option, I am not convinced that an option to control whether "{}" or "{ }" carries its weight.

Ping?

SpaceAfterTemplateKeyword exists by now.

mamai added a subscriber: mamai.Mar 25 2021, 11:50 AM
MyDeveloperDay added a subscriber: MyDeveloperDay.EditedJun 12 2021, 3:12 AM

This is already resolved with SpaceAfterTemplateKeyword and SpaceInEmptyBlock I'm going to commandeer and abandon this old version to try and clean up some of the legacy reviews

MyDeveloperDay commandeered this revision.Jun 12 2021, 3:12 AM
MyDeveloperDay abandoned this revision.
MyDeveloperDay added a project: Restricted Project.
MyDeveloperDay edited reviewers, added: mxbOctasic; removed: MyDeveloperDay.