[clang-tools-extra] [clang-doc]: Enable horizontal wrapping on longer function definitions (PR #181417)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 14:18:10 PST 2026
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 origin/main HEAD --extensions cpp -- clang-tools-extra/clang-doc/JSONGenerator.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-doc/JSONGenerator.cpp b/clang-tools-extra/clang-doc/JSONGenerator.cpp
index 0586aca5f..61c2d5718 100644
--- a/clang-tools-extra/clang-doc/JSONGenerator.cpp
+++ b/clang-tools-extra/clang-doc/JSONGenerator.cpp
@@ -460,7 +460,7 @@ static void serializeArray(const Container &Records, Object &Obj,
size_t TotalLength = 0;
for (const auto &Val : RecordsArrayRef) {
if (const auto *ItemObj = Val.getAsObject()) {
- if (auto Type = ItemObj->getString("Type"))
+ if (auto Type = ItemObj->getString("Type"))
TotalLength += Type->size();
if (auto Name = ItemObj->getString("Name"))
TotalLength += Name->size();
@@ -469,8 +469,7 @@ static void serializeArray(const Container &Records, Object &Obj,
}
if (TotalLength > 15) {
Obj["IsLong"] = true;
- }
- else {
+ } else {
Obj["IsLong"] = false;
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/181417
More information about the cfe-commits
mailing list