<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143877>143877</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format set short lambda max length?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Vladislav-Bartalevich
</td>
</tr>
</table>
<pre>
Is it possible to set a maximum length for short lambdas?
In my project, I want to achieve two things:
* Short lambdas should stay on a single line (so I have AllowShortLambdasOnASingleLine: All)
* Allman-style line breaks before braces for long lambdas (so I have BreakBeforeBraces: Allman)
However, it seems that clang-format uses a default maximum line length of 90 characters for short lambdas. When the line length reaches or exceeds 90, clang-format always introduces a line break.
>From a code formatting perspective, I want this:
```
auto SomeLongOneLiner = [](int SomeLongPieceOfCodeHere) { return SomeLongPieceOfCodeHere != 2; }; // 114 characters
```
To remain on a single line as shown above. But when I run the formatter, it transforms the code into:
```
auto SomeLongOneLiner = [](int SomeLongPieceOfCodeHere)
{ return SomeLongPieceOfCodeHere != 2; };
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VNGK6zYQ_Rr5ZUiw5WQdP_jBuUu4gYUtbGmfx_LYVitLQRo7N39f5PjuZrv0pXAhIJLMOXN05mgwBN1bokrsj2L_nODEg_PVHwZbHQzOmyN6RkOzVkPSuPZWnQNohosLQTeGgB0EYkAY8YcepxEM2Z4H6JyHMDjPYHBsWgwiP4m0Fml9tjDe4OLdX6RYyG9whitajkyoBk0zAV8d8KBtH0Re31FC1vD2yBfZJ9NCYLyBs4AQtO0NgdGWQMhDcHCGAWeC2hh3XcAvd-yrrd-W4hdtSeR1rBCyXNvUxoxoN4FvP9kaT_h3gIY65-M3VBSWGxpn-3dBn3oeI-S4AI5L_dpmRLt2Suvv7koz-eiBZghEYwAekEEZtP2mc35EhilQAISWOpwMf_gcha1muw7KFNSAHhWTD1_d38KfA1nggT4BPaEaKIDzQD8UURugTKOeTwrQXPEWQFv2rp3UIufDl-39MifvRkBQriW441jbHi7kw4UU65keZz3on6N9StdPWuPEDt7cSC_O9q92mY4HkT_DPZ1CHrTl94rfNCl67b65lr6TJyFLEMURPPHk7X9VgZBZZJQiP4IonuMBQp6EPEGW7R5M_Je43x14GlHbr2G7h_FqARs30xaOE8M12n0GP91NXx15HzZ7tCH-GJa_F9e0ZfcLTIl8_8eWRx1JW-VtmZeYUJUVu7KQRZGWyVChekIqqCy7vNjti1Q2-0N-yErqmqZJ2yzRlUzlPn3KZJbJgyy3RVkeFOX0VKpMHXal2KXRVrM1Zh63zveJDmGiKtvlh6JIDDZkwrKepHxMpZAyLixfRdymmfogdqnRgcMHE2s2VH3KclxWjy8jvqf1NYj8lEzeVAPzZUnnkope8zA1W-VGIU-ReT027xvstAgOQp5WzXMl_wkAAP__gIHA-w">