[clang] [clang-format] Separate License text and include blocks (PR #77918)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 13 03:57:40 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 2798b72ae7e5caad793169b77cbac47fe2362d0f 291c05994202393a858de1aafa8eeaf958223964 -- clang/include/clang/Format/Format.h clang/lib/Format/DefinitionBlockSeparator.cpp clang/lib/Format/Format.cpp clang/lib/Format/TokenAnnotator.h clang/unittests/Format/ConfigParseTest.cpp clang/unittests/Format/DefinitionBlockSeparatorTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Format/DefinitionBlockSeparator.cpp b/clang/lib/Format/DefinitionBlockSeparator.cpp
index 0bed68f0e6..635adc1435 100644
--- a/clang/lib/Format/DefinitionBlockSeparator.cpp
+++ b/clang/lib/Format/DefinitionBlockSeparator.cpp
@@ -89,7 +89,7 @@ void DefinitionBlockSeparator::separateBlocks(
Env.getSourceManager().getBufferData(Env.getFileID()),
Style.LineEnding == FormatStyle::LE_DeriveCRLF)
: Style.LineEnding == FormatStyle::LE_CRLF);
- bool InLicenseText { true };
+ bool InLicenseText{true};
for (unsigned I = 0; I < Lines.size(); ++I) {
const auto &CurrentLine = Lines[I];
if (CurrentLine->InMacroBody)
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index 8c8581f11d..2f751ab0d8 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -996,11 +996,16 @@ TEST(ConfigParseTest, ParsesConfiguration) {
AllowBreakBeforeNoexceptSpecifier, FormatStyle::BBNSS_Never);
Style.SeparateDefinitionBlocks = FormatStyle::SDS_Never;
- CHECK_PARSE("SeparateDefinitionBlocks: One", SeparateDefinitionBlocks, FormatStyle::SDS_One);
- CHECK_PARSE("SeparateDefinitionBlocks: Two", SeparateDefinitionBlocks, FormatStyle::SDS_Two);
- CHECK_PARSE("SeparateDefinitionBlocks: Leave", SeparateDefinitionBlocks, FormatStyle::SDS_Leave);
- CHECK_PARSE("SeparateDefinitionBlocks: Always", SeparateDefinitionBlocks, FormatStyle::SDS_One);
- CHECK_PARSE("SeparateDefinitionBlocks: Never", SeparateDefinitionBlocks, FormatStyle::SDS_Never);
+ CHECK_PARSE("SeparateDefinitionBlocks: One", SeparateDefinitionBlocks,
+ FormatStyle::SDS_One);
+ CHECK_PARSE("SeparateDefinitionBlocks: Two", SeparateDefinitionBlocks,
+ FormatStyle::SDS_Two);
+ CHECK_PARSE("SeparateDefinitionBlocks: Leave", SeparateDefinitionBlocks,
+ FormatStyle::SDS_Leave);
+ CHECK_PARSE("SeparateDefinitionBlocks: Always", SeparateDefinitionBlocks,
+ FormatStyle::SDS_One);
+ CHECK_PARSE("SeparateDefinitionBlocks: Never", SeparateDefinitionBlocks,
+ FormatStyle::SDS_Never);
}
TEST(ConfigParseTest, ParsesConfigurationWithLanguages) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/77918
More information about the cfe-commits
mailing list