clang-format: Add CompactNamespaces option
Summary: Add CompactNamespaces option, to pack namespace declarations on the same line (somewhat similar to C++17 nested namespace definition). With this option, consecutive namespace declarations are kept on the same line: namespace foo { namespace bar { ... }} // namespace foo::bar Reviewers: krasimir, djasper, klimek Reviewed By: djasper Subscribers: kimgr, cfe-commits, klimek Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32480 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305384 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Format/Format.h 24 additions, 0 deletionsinclude/clang/Format/Format.h
- lib/Format/Format.cpp 5 additions, 3 deletionslib/Format/Format.cpp
- lib/Format/NamespaceEndCommentsFixer.cpp 48 additions, 16 deletionslib/Format/NamespaceEndCommentsFixer.cpp
- lib/Format/UnwrappedLineFormatter.cpp 65 additions, 4 deletionslib/Format/UnwrappedLineFormatter.cpp
- lib/Format/UnwrappedLineParser.cpp 5 additions, 0 deletionslib/Format/UnwrappedLineParser.cpp
- unittests/Format/FormatTest.cpp 136 additions, 0 deletionsunittests/Format/FormatTest.cpp
- unittests/Format/NamespaceEndCommentsFixerTest.cpp 56 additions, 0 deletionsunittests/Format/NamespaceEndCommentsFixerTest.cpp
Loading
Please register or sign in to comment