[
https://issues.apache.org/jira/browse/MNGSITE-480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493132#comment-17493132
]
Slawomir Jaranowski edited comment on MNGSITE-480 at 2/16/22, 10:03 AM:
------------------------------------------------------------------------
There are {{tokens}} properties for {{LeftCurly}} and can be used
[https://checkstyle.sourceforge.io/config_blocks.html#LeftCurly]
For Idea is probably new options: {{Braces ... In lambda ...}}
in idea xml formater, can be added:
{code:java}
<option name="LAMBDA_BRACE_STYLE" value="to check" />
{code}
was (Author: slawekjaranowski):
There are {{tokens}} properties for {{LeftCurly}} and can be used
https://checkstyle.sourceforge.io/config_blocks.html#LeftCurly
For Idea is probably new options: {{Braces ... In lambda ...}}
in idea xml formater, can be added:
{code}
<option name="LAMBDA_BRACE_STYLE" value="2" />
{code}
> IDE Codestyle vs Maven Checkstyle: a bossfight
> ----------------------------------------------
>
> Key: MNGSITE-480
> URL: https://issues.apache.org/jira/browse/MNGSITE-480
> Project: Maven Project Web Site
> Issue Type: Bug
> Reporter: Tamás Cservenák
> Priority: Major
> Attachments: Screenshot 2022-02-16 at 10.40.07.png
>
>
> Codestyle updated in MNGSITE-465 for Idea has discrepancies wrt checkstyle
> plugin rules.
>
> Typical example:
> IDEA IDE reformat result:
> {noformat}
> StreamSupport.stream( iteratorSearchResponse.iterator().spliterator(), false )
> .sorted( ArtifactInfo.VERSION_COMPARATOR ).forEach( ai -> {
> artifactInfos.add( ai );
> page.add( convert( ai, null ) );
> } );
> {noformat}
> But, checktyle:
> {noformat}
> [ERROR]
> src/main/java/org/apache/maven/index/search/backend/indexer/internal/IndexerCoreSearchBackendImpl.java:[127,83]
> (blocks) LeftCurly: '{' at column 83 should be on a new line.{noformat}
> In short, for me it looks like our checkstyle is too rigid, unprepared for
> Java 8 lambdas? (as IMHO the code snippet above with curly on next line would
> look awkward).
--
This message was sent by Atlassian Jira
(v8.20.1#820001)