[all-commits] [llvm/llvm-project] f21c70: clang-format: Add ControlStatementsExceptForEachMa...

Daan De Meyer via All-commits all-commits at lists.llvm.org
Wed May 6 11:59:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f21c704553a8af7012eaf1ab777e2aa1a55cc86d
      https://github.com/llvm/llvm-project/commit/f21c704553a8af7012eaf1ab777e2aa1a55cc86d
  Author: Daan De Meyer <daan.j.demeyer at gmail.com>
  Date:   2020-05-06 (Wed, 06 May 2020)

  Changed paths:
    M clang/docs/ClangFormatStyleOptions.rst
    M clang/include/clang/Format/Format.h
    M clang/lib/Format/Format.cpp
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  clang-format: Add ControlStatementsExceptForEachMacros option to SpaceBeforeParens

Summary: systemd recently added a clang-format file. One issue I
encountered in using clang-format on systemd is that systemd does
not add a space before the parens of their foreach macros but
clang-format always adds a space. This does not seem to be
configurable in clang-format. This revision adds the
ControlStatementsExceptForEachMacros option to SpaceBeforeParens
which puts a space before all control statement parens except
ForEach macros. This drastically reduces the amount of changes
when running clang-format on systemd's source code.

Reviewers: MyDeveloperDay, krasimir, mitchell-stellar

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D78869




More information about the All-commits mailing list