Usage of ParenPad Check
Brett Walker <[email protected]> Wed, 26 Dec 2012 17:19:46 +1100
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
--===============7940264658911926686==
Content-Language: en-AU
Content-Type: multipart/alternative;
boundary="_000_4B95BC7335A13A42AD0D23462F91AE6F616D30375Eechogeometryi_"
--_000_4B95BC7335A13A42AD0D23462F91AE6F616D30375Eechogeometryi_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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 be=
ing familiar enough with Checkstyle and the configuration options.
The problem I have is with the ParenPad check with a token type of METHOD_C=
ALL (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 statem=
ent, text for an email or some other long string; I like to provide a LTR f=
eel to the statements used in build up the long string so that it is a litt=
le 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 afte=
r 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 configurat=
ion do I need? Are there 'tricks' in using Checkstyle to accomplish this? A=
re there Checkstyle extension to do what I need? Or do I need to write a cu=
stom check?
Seeking any help or advice.
Thanks in advance,
Brett Walker
--_000_4B95BC7335A13A42AD0D23462F91AE6F616D30375Eechogeometryi_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html dir=3D"ltr"><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style id=3D"owaTempEditStyle"></style><style title=3D"owaParaStyle"><!--P =
{
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi=3D"x">
<div style=3D"FONT-FAMILY: Tahoma; DIRECTION: ltr; COLOR: #000000; FONT-SIZ=
E: 13px">
<div></div>
<font color=3D"#000000" size=3D"2" face=3D"Tahoma">
<div dir=3D"ltr"><font face=3D"Courier">Hi Checkstyle Users,</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">I am new to Checkstyle but I do lov=
e what it does. I use it mainly through the Maven Checkstyle plugin.</font>=
</div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">I have a situation where Checkstyle=
lacks flexibility. I could be me not being familiar enough with Checkstyle=
and the configuration options.</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">The problem I have is with the Pare=
nPad check with a token type of METHOD_CALL (I believe).</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">In the majority of the cases I don'=
t allow any spaces.</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier"> e.g. object=
.method(arg1); &=
nbsp; &nbs=
p; Case 1</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">But when I am using StringBuffer or=
StringBuilder in building an SQL statement, text for an email or some othe=
r 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.</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier"> e.g. buffer=
.append("String 1 "); &n=
bsp; Case =
2<br>
buffer.append( &=
nbsp; variable);<br>
buffer.append( &=
nbsp; &nbs=
p; " String 2");</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">The style that I am trying to get i=
s to allow none, one or many spaces after the LParen of a Method Call but n=
o spaces before the RParen of the Method Call.</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">It seems that I cannot configure Ch=
eckstyle to allow this. It seems that I need to disable the ParenPad test a=
ll together which I find too drastic.</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"Courier">Please advise how I might accomplis=
h this using Checkstyle. What configuration do I need? Are there 'tricks' i=
n using Checkstyle to accomplish this? Are there Checkstyle extension to do=
what I need? Or do I need to write
a custom check?</font></div>
<div dir=3D"ltr"><font face=3D"Courier"></font> </div>
<div dir=3D"ltr"><font face=3D"courier">Seeking any help or advice.</font><=
/div>
<div dir=3D"ltr"><font face=3D"courier"></font> </div>
<div dir=3D"ltr"><font face=3D"courier">Thanks in advance,</font></div>
<div dir=3D"ltr"><font face=3D"Courier">Brett Walker<br>
</font></font></div>
</div>
</body>
</html>
--_000_4B95BC7335A13A42AD0D23462F91AE6F616D30375Eechogeometryi_--
--===============7940264658911926686==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
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
--===============7940264658911926686==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Checkstyle-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
--===============7940264658911926686==--