[PATCH] D67773: [clang-format[PR43144] Add support for SpaceAroundBraces style

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 12:52:38 PDT 2019


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: klimek, owenpan.
MyDeveloperDay added a project: clang-tools-extra.
Herald added a project: clang.

This is to address a request made in https://bugs.llvm.org/show_bug.cgi?id=43144

Add the ability to not have a space before and after brace (limited to if,else,for,while,do keyword (for now))

  if (x){
  }else if{
  }else{
  }



  do{
  }while(x)



  while(x){
  }



  for(int i=0;i<size();i++){
  }

nb. I have not affiliation with the 3sfs project (https://github.com/s3fs-fuse/s3fs-fuse) but noticed on reading this request they don't have a .clang-format file in their Github repo. Perhaps this is because without this feature we can't support their style at all.  My aim here is to further the reach of clang-format whilst increasing my knowledge of the workings for clang-format.


Repository:
  rC Clang

https://reviews.llvm.org/D67773

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67773.220895.patch
Type: text/x-patch
Size: 37586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190919/29a5cda9/attachment-0001.bin>


More information about the cfe-commits mailing list