[PATCH] D98429: [clang-format] Add new option to clang-format: SpaceBeforeForLoopSemiColon

Nathan Hjelm via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 11 08:23:56 PST 2021


hjelmn created this revision.
hjelmn added reviewers: krasimir, djasper.
hjelmn requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The option SpaceBeforeForLoopSemiColon controls whether clang-format puts
a space before the semi-colons in a for loop. When disabled (default) there
is no change to the current behavior. When enabled clang-format will put a
space before semi-colons in for loops:

enabled:

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

disabled:

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

Signed-off-by: Nathan Hjelm <hjelmn at google.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98429

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98429.329974.patch
Type: text/x-patch
Size: 5922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210311/9572e2c1/attachment-0001.bin>


More information about the cfe-commits mailing list