Usage of ParenPad Check

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Usage of ParenPad Check

Brett Walker
Hi Checkstyle Users,
 
I am new to Checkstyle but I do love what it does. I use it mainly through the Maven Checkstyle plugin.
 
I have a situation where Checkstyle lacks flexibility. I could be me not being familiar enough with Checkstyle and the configuration options.
 
The problem I have is with the ParenPad check with a token type of METHOD_CALL (I believe).
 
In the majority of the cases I don't allow any spaces.
 
    e.g. object.method(arg1);                          Case 1
 
But when I am using StringBuffer or StringBuilder in building an SQL statement, text for an email or some other long string; I like to provide a LTR feel to the statements used in build up the long string so that it is a little easier to read.
 
    e.g. buffer.append("String 1 ");                   Case 2
         buffer.append(          variable);
         buffer.append(                 " String 2");
 
The style that I am trying to get is to allow none, one or many spaces after the LParen of a Method Call but no spaces before the RParen of the Method Call.
 
It seems that I cannot configure Checkstyle to allow this. It seems that I need to disable the ParenPad test all together which I find too drastic.
 
Please advise how I might accomplish this using Checkstyle. What configuration do I need? Are there 'tricks' in using Checkstyle to accomplish this? Are there Checkstyle extension to do what I need? Or do I need to write a custom check?
 
Seeking any help or advice.
 
Thanks in advance,
Brett Walker

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Loading...