Whitespace Exceptions

70 views
Skip to first unread message

Jacob Tomaw

unread,
Feb 20, 2014, 5:11:14 PM2/20/14
to check...@googlegroups.com
Hello:

I am trying to implement the Google Java Style in checkstyle. It has been a fun way to learn more about Checkstyle and internalize the style. I have run into a roadblock and need some assistance.

There is section 4.6.2 Horizontal whitespace which is mostly the WhitespaceAround checkstyle check. However there is an exception that allows 
@SomeAnnotation({a, b}) 
with no space around the curlies. WhitespaceAround marks this as requiring a space after the rcurly. Is there a way to allow this with the standard checks?

Thank you,
Jacob Tomaw

Roman Ivanov

unread,
Feb 20, 2014, 7:51:11 PM2/20/14
to Jacob Tomaw, check...@googlegroups.com
No this not possible right now http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAround

But I do believe that we need to extend this Check to allow that like we did with "allowEmptyConstructors", ... .




--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jacob Tomaw

unread,
Feb 21, 2014, 11:54:35 AM2/21/14
to check...@googlegroups.com, Jacob Tomaw
Roman:

Thank you for your prompt reply.  

Is a new optional exemption what is needed or is enhancing the check to skip RCURLY and LCURLY for 

TokenTypes.ANNOTATION_ARRAY_INIT and there is for TokenTypes.ARRAY_INIT? It seem like this is just an oversight to allow no space if the parent is Array Init and not Annotation Array Init.

If this is an acceptable solution, I have made the changes locally with tests. I can submit a pull request.

Thanks again,

Jacob

//CCed in issue tracker

Reply all
Reply to author
Forward
0 new messages