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( " 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?