Checkstyle disabling

Daniel Fisher dfisher at vt.edu
Fri Aug 2 15:05:09 EDT 2013


On Fri, Aug 2, 2013 at 2:58 PM, Ian Young <ian at iay.org.uk> wrote:

> This is the note Scott was referring to.  Sorry, I just sent it to him
> originally as he said he was going to look into this.
>
>
> http://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code
>
> One thing that only became apparent to me after reading this several times
> is that you need to include the SuppressionCommentFilter module in the
> Checkstyle configuration.  So, examples like Daniel's don't do anything as
> written unless you add this; they are just ignored.
>
> It also looks like the //CHECKSTYLE.OFF: WhichTestToDisable form is just
> sugar: it's not disabling just that test but everything, depending on what
> your SuppressionCommentFilter definition has in it.  Some examples here:
>
> http://checkstyle.sourceforge.net/config.html


This is the config I've been using:

  <module name="SuppressionCommentFilter">
    <property name="offCommentFormat" value="CheckStyle\:([\w\|]+) OFF"/>
    <property name="onCommentFormat" value="CheckStyle\:([\w\|]+) ON"/>
    <property name="checkFormat" value="$1"/>
  </module>

--DF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20130802/c48b55e7/attachment.html 


More information about the dev mailing list