[all-commits] [llvm/llvm-project] dda978: [clang-format] Option for empty lines after an acc...

Max Sagebaum via All-commits all-commits at lists.llvm.org
Thu Apr 15 12:03:27 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dda978eef87c57e254929848956d46f6db75c125
      https://github.com/llvm/llvm-project/commit/dda978eef87c57e254929848956d46f6db75c125
  Author: Max Sagebaum <max.sagebaum at scicomp.uni-kl.de>
  Date:   2021-04-15 (Thu, 15 Apr 2021)

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

  Log Message:
  -----------
  [clang-format] Option for empty lines after an access modifier.

The current logic for access modifiers in classes ignores the option 'MaxEmptyLinesToKeep=1'. It is therefore impossible to have a coding style that requests one empty line after an access modifier. The patch allows the user to configure how many empty lines clang-format should add after an access modifier. This will remove lines if there are to many and will add them if there are missing.

Reviewed By: MyDeveloperDay, curdeius

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




More information about the All-commits mailing list