<div dir="ltr">On Fri, Aug 2, 2013 at 2:58 PM, Ian Young <span dir="ltr"><<a href="mailto:ian@iay.org.uk" target="_blank">ian@iay.org.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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.<br>
<br>
<a href="http://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code" target="_blank">http://stackoverflow.com/questions/4023185/how-to-disable-a-particular-checkstyle-rule-for-a-particular-line-of-code</a><br>
<br>
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.<br>
<br>
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:<br>
<br>
<a href="http://checkstyle.sourceforge.net/config.html" target="_blank" rel="noreferrer">http://checkstyle.sourceforge.net/config.html</a></blockquote><div><br></div><div>This is the config I've been using:</div><div>
<br></div><div> <module name="SuppressionCommentFilter"></div><div> <property name="offCommentFormat" value="CheckStyle\:([\w\|]+) OFF"/></div><div> <property name="onCommentFormat" value="CheckStyle\:([\w\|]+) ON"/></div>
<div> <property name="checkFormat" value="$1"/></div><div> </module> </div><div><br></div><div>--DF</div><div><br></div></div></div></div>