[clang-format] Add AlignConsecutiveShortCaseStatements
authorGalen Elias <galenelias@gmail.com>
Tue, 25 Jul 2023 01:05:51 +0000 (18:05 -0700)
committerOwen Pan <owenpiano@gmail.com>
Tue, 25 Jul 2023 01:39:25 +0000 (18:39 -0700)
commit74720d1b338efb0725dd80bf3e59069700f6e2f0
treed4c2b3a8f2b25381c2a441e7b3a62a06f4530c17
parent87ad34ffdcf2de99dab0ac86f148a03e4bd2dddc
[clang-format] Add AlignConsecutiveShortCaseStatements

This adds a new AlignConsecutiveShortCaseStatements option in line with the
existing AlignConsecutive* options , which when
AllowShortCaseLabelsOnASingleLine is enabled will align the tokens after the
case statement's colon. This also adds a AlignCaseColons option to allow
aligning the case label colon itself rather than the token after it.

Fixes #55475.

Differential Revision: https://reviews.llvm.org/D151761
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/lib/Format/WhitespaceManager.h
clang/unittests/Format/ConfigParseTest.cpp
clang/unittests/Format/FormatTest.cpp