checkstyle / eclipse-cs

The Eclipse Checkstyle plug-in integrates the Checkstyle Java code auditor into the Eclipse IDE. The plug-in provides real-time feedback to the user about violations of rules that check for coding style and possible error prone code constructs.
https://checkstyle.org/eclipse-cs
GNU Lesser General Public License v2.1
97 stars 55 forks source link

LeftCurly FormatterSettings missing for LAMBDA #101

Open MSJones6 opened 6 years ago

MSJones6 commented 6 years ago

Hi,

I use the actual checkstyle plugin (version 8.12.0.201808161509). It seems, that the transformer to codeformatter does not support the token "LAMBDA". No errors in Eclipse message log. The expression will simply be ignored while creating the formatter.

In the code itsself, the curly bracket is marked as wrong formatted. So, this function works correct.

If I'm correct, the following code is missing in the eclipse-cs/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/LeftCurlyTransformer.java (Line 77): } else if (tok.equals("LAMBDA")) { userFormatterSetting("brace_position_for_lambda_body", option); }

I'm using Eclipse Oxygen.3a (Release 4.7.3a)

rnveach commented 6 years ago

https://github.com/checkstyle/eclipse-cs/blob/master/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/LeftCurlyTransformer.java#L55 http://checkstyle.sourceforge.net/config_blocks.html#LeftCurly There are quite a few tokens missing. I'm not sure which is on purpose and which is missed.

https://github.com/checkstyle/eclipse-cs/blob/master/net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/transformer/ctransformerclasses/RightCurlyTransformer.java#L56 http://checkstyle.sourceforge.net/config_blocks.html#RightCurly Looks the same for right curly too.

If any are missed on purpose, like not supported in eclipse, then a comment should be made in the source so it is clear and not assumed.

lkoe commented 6 years ago

This functionality is part of a contribution made as part of a bachelor thesis. I've never gotten around digging into the code. I had even toyed with the idea removing this feature altogether, since it's effectively unmaintained.

If someone wants to step up, please do.