<div dir="ltr">No, there is no option to control this. However, you can add braces around the lambda body which will help in this case and reduce indentation even further:<div><br></div><div><div> entries.forEach(entry -> {</div><div> assertTrue(String.format("Host set includes '%s'", entry.getName()),</div><div> hostNames.contains(entry.getName()));</div><div> });</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 6:32 PM, Skyler Hawthorne via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hello,</div><div><br></div><div>I was wondering if it is possible to configure clang-format to not break the line before the Java 8 lambda operator. For example,</div><div><br></div><div><pre><code><span> entries</span><span>.</span><span>forEach</span><span>(</span><span>entry </span><span>-></span><span>
assertTrue</span><span>(</span><span>String</span><span>.</span><span>format</span><span>(</span><span>"Host set includes '%s'"</span><span>,</span><span>
entry</span><span>.</span><span>getName</span><span>()),</span><span>
hostNames</span><span>.</span><span>contains</span><span>(</span><span>entry</span><span>.</span><span>getName</span><span>())));</span></code></pre></div><div><br></div><div>gets turned into:</div><div><br></div><div><pre><code><span> entries</span><span>.</span><span>forEach</span><span>(</span><span>entry
</span><span>-></span><span> assertTrue</span><span>(</span><span>String</span><span>.</span><span>format</span><span>(</span><span>"Host set includes '%s'"</span><span>,</span><span>
entry</span><span>.</span><span>getName</span><span>()),</span><span>
hostNames</span><span>.</span><span>contains</span><span>(</span><span>entry</span><span>.</span><span>getName</span><span>())));</span></code></pre></div><div><br></div><div>This is my .clang-format:</div><div><br></div><div><font face="monospace">---</font></div><div><font face="monospace">Language: Java</font></div><div><font face="monospace">AccessModifierOffset: -2</font></div><div><font face="monospace">AlignAfterOpenBracket: true</font></div><div><font face="monospace">AlignConsecutiveAssignments: false</font></div><div><font face="monospace">AlignEscapedNewlinesLeft: false</font></div><div><font face="monospace">AlignOperands: false</font></div><div><font face="monospace">AlignTrailingComments: true</font></div><div><font face="monospace">AllowAllParametersOfDeclarationOnNextLine: true</font></div><div><font face="monospace">AllowShortBlocksOnASingleLine: false</font></div><div><font face="monospace">AllowShortCaseLabelsOnASingleLine: false</font></div><div><font face="monospace">AllowShortFunctionsOnASingleLine: All</font></div><div><font face="monospace">AllowShortIfStatementsOnASingleLine: false</font></div><div><font face="monospace">AllowShortLoopsOnASingleLine: false</font></div><div><font face="monospace">AlwaysBreakAfterDefinitionReturnType: None</font></div><div><font face="monospace">AlwaysBreakBeforeMultilineStrings: false</font></div><div><font face="monospace">AlwaysBreakTemplateDeclarations: false</font></div><div><font face="monospace">BinPackArguments: true</font></div><div><font face="monospace">BinPackParameters: false</font></div><div><font face="monospace">BreakBeforeBinaryOperators: false</font></div><div><font face="monospace">BreakBeforeBraces: Attach</font></div><div><font face="monospace">BreakBeforeTernaryOperators: false</font></div><div><font face="monospace">BreakConstructorInitializersBeforeComma: false</font></div><div><font face="monospace">ColumnLimit: 85</font></div><div><font face="monospace">ConstructorInitializerAllOnOneLineOrOnePerLine: false</font></div><div><font face="monospace">ConstructorInitializerIndentWidth: 4</font></div><div><font face="monospace">ContinuationIndentWidth: 8</font></div><div><font face="monospace">DerivePointerAlignment: false</font></div><div><font face="monospace">ExperimentalAutoDetectBinPacking: false</font></div><div><font face="monospace">IndentCaseLabels: false</font></div><div><font face="monospace">IndentWidth: 4</font></div><div><font face="monospace">IndentWrappedFunctionNames: false</font></div><div><font face="monospace">KeepEmptyLinesAtTheStartOfBlocks: true</font></div><div><font face="monospace">MaxEmptyLinesToKeep: 1</font></div><div><font face="monospace">NamespaceIndentation: None</font></div><div><font face="monospace">PenaltyBreakBeforeFirstCallParameter: 19</font></div><div><font face="monospace">PenaltyBreakComment: 300</font></div><div><font face="monospace">PenaltyBreakFirstLessLess: 120</font></div><div><font face="monospace">PenaltyBreakString: 1000</font></div><div><font face="monospace">PenaltyExcessCharacter: 1000000</font></div><div><font face="monospace">PenaltyReturnTypeOnItsOwnLine: 60</font></div><div><font face="monospace">PointerAlignment: Right</font></div><div><font face="monospace">SpaceAfterCStyleCast: false</font></div><div><font face="monospace">SpaceBeforeAssignmentOperators: true</font></div><div><font face="monospace">SpaceBeforeParens: ControlStatements</font></div><div><font face="monospace">SpaceInEmptyParentheses: false</font></div><div><font face="monospace">SpacesBeforeTrailingComments: 1</font></div><div><font face="monospace">SpacesInAngles: false</font></div><div><font face="monospace">SpacesInContainerLiterals: true</font></div><div><font face="monospace">SpacesInCStyleCastParentheses: false</font></div><div><font face="monospace">SpacesInParentheses: false</font></div><div><font face="monospace">SpacesInSquareBrackets: false</font></div><div><font face="monospace">TabWidth: 4</font></div><div><font face="monospace">UseTab: Never</font></div><div><font face="monospace">...</font></div><span class="HOEnZb"><font color="#888888"><div></div><div><br></div><div><span><pre>--
<html> <body> <div style="font-family: sans-serif; font-size: 12px; width: 600px; border-width: 1px 0px 0px 0px; border-color: #b0b0b0; border-style: solid; padding: 10px;"> <table cellpadding="0" cellspacing="0" style="font-family: sans-serif; font-size: 12px; width: 100%;"> <tr> <td style="text-align: left; vertical-align: top; width: 545px;"> <div style="font-size: 14px; font-weight: bold;">Skyler Hawthorne</div> <div>Research Systems Software Engineer</div> </td> <!-- OpenDNS logo --> <td style="text-align: left; vertical-align: top; width: 101px; padding-left: 10px;"> <a href="<a href="http://opendns.com" target="_blank">http://opendns.com</a>"><img alt="OpenDNS" src="<a href="http://images.disthost.opendns.com/signature/opendns_cisco.png" target="_blank">http://images.disthost.opendns.com/signature/opendns_cisco.png</a>" /></a> </td> </tr> </table> </div> <div style="font-family: sans-serif; font-size: 12px; width: 600px; border-width: 1px 0px 0px 0px; border-color: #b0b0b0; border-style: solid; padding: 10px;"> <table cellpadding="0" cellspacing="0" style="font-family: sans-serif; font-size: 12px; width: 100%;"> <tr> <td style="text-align: left; vertical-align: top; width: 4em;"> <span style="font-weight: bold; color: #909090;">Mobile:</span><br /> </td> <td style="text-align: left; vertical-align: top;"> +1-510-371-4123<br /> </td> <td style="text-align: left; vertical-align: top; padding-left: 10px; width: 4em;"> <span style="font-weight: bold; color: #909090;">Email:</span><br /> <span style="font-weight: bold; color: #909090;">IM:</span><br /> </td> <td style="text-align: left; vertical-align: top;"> <a href="mailto:<a href="mailto:skhawtho@cisco.com" target="_blank">skhawtho@cisco.com</a>" style="text-decoration: none; color: #000"><a href="mailto:skhawtho@cisco.com" target="_blank">skhawtho@cisco.com</a></a><br /> <a href="xmpp:skhawtho%<a href="http://40cisco.com?message" target="_blank">40cisco.com?message</a>" style="text-decoration: none; color: #000;"><a href="mailto:skhawtho@cisco.com" target="_blank">skhawtho@cisco.com</a></a> (XMPP)<br /> </td> <!-- SS:address_135_bluxome --> <td style="text-align: left; vertical-align: top; padding-left: 10px;"> <a target="_blank" href="<a href="http://opendns.com/" target="_blank">http://opendns.com/</a>" style="color: #f07000;"><b>OpenDNS</b></a><br> <a target="_blank" href="<a href="http://maps.google.com/maps?q=135+Bluxome+Street%2CSan+Francisco%2CCA+94107%2CUnited+States&hl=en" target="_blank">http://maps.google.com/maps?q=135+Bluxome+Street%2CSan+Francisco%2CCA+94107%2CUnited+States&hl=en</a>" style="text-decoration: none; color: #000000">135 Bluxome St<br />San Francisco, CA 94107<br />United States</a> </td> <!-- SE:address_135_bluxome --> <td style="text-align: right; vertical-align: top; width: 82px;"> <a href="<a href="http://github.com/opendns" target="_blank">http://github.com/opendns</a>" title="Github"><img alt="GH" src="<a href="http://images.disthost.opendns.com/signature/github.png" target="_blank">http://images.disthost.opendns.com/signature/github.png</a>" /></a> </td> </tr> </table> </div> <br /> </body></html></pre></span></div></font></span></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>