This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Add SpaceBeforeTemplateParameterList option
AbandonedPublic

Authored by MyDeveloperDay on Nov 23 2015, 7:25 AM.

Details

Reviewers
nrieck
Summary

Adds an option to control whether a space is inserted between "template" and "<". Currently a space is always inserted (as the LLVM style requires), but to me this seems like the less popular option.

Looking at a few files from Mozilla and Chromium they seem to also skip the space. Should this option be disabled for their styles?

Diff Detail

Event Timeline

nrieck updated this revision to Diff 40927.Nov 23 2015, 7:25 AM
nrieck retitled this revision from to clang-format: Add SpaceBeforeTemplateParameterList option.
nrieck updated this object.
nrieck added a subscriber: cfe-commits.

This has come up before (read up on the list) and the decision is not to support it. In short, this is so un-important, that it is not worth a configuration option.

MyDeveloperDay added a project: Restricted Project.

This revision would require unit tests to proceed

Style guide suggesting enforcing a space after template keyword

https://mesos.readthedocs.io/en/1.1.0/c++-style-guide/

MyDeveloperDay added inline comments.Oct 31 2019, 3:26 AM
include/clang/Format/Format.h
500

I suggest we make this an enumeration

enum {
Unaltered,
Never,
Always,
}

Introducing this into a codebase means we need to select a suitable default, doing nothing would in my view be the best default and introducing anything new now will cause a tidal wave of changes on any existing formatted code base

LLVM alone it pretty much 50/50 on if they use a space or not

This I believe is covered by SpaceAfterTemplateKeyword which does the same thing

MyDeveloperDay commandeered this revision.Nov 1 2019, 7:40 AM
MyDeveloperDay abandoned this revision.
MyDeveloperDay edited reviewers, added: nrieck; removed: MyDeveloperDay.