[
https://jira.codehaus.org/browse/MCHECKSTYLE-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=351617#comment-351617
]
Dennis Lundberg commented on MCHECKSTYLE-247:
---------------------------------------------
I think it would be a better approach to use @SuppressWarnings annotations for
this, in most cases. This is the standard mechanism in the Java language to
suppress warnings of different kinds. Adding comments in the code means you
have to learn the format for each type of suppression, as each tool most likely
has their own format.
See
http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder
and http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarnings.
Using annotations you would do it like this:
{code:java}
@SuppressWarnings("checkstyle:linelength")
{code}
> add CHECKSTYLE_OFF/ON: regexp support (SuppressionCommentFilter)
> ----------------------------------------------------------------
>
> Key: MCHECKSTYLE-247
> URL: https://jira.codehaus.org/browse/MCHECKSTYLE-247
> Project: Maven Checkstyle Plugin
> Issue Type: Wish
> Affects Versions: 2.12.1
> Reporter: Herve Boutemy
> Assignee: Herve Boutemy
> Fix For: 2.13
>
>
> see http://checkstyle.sourceforge.net/config.html#SuppressionCommentFilter
> being able to write:
> {code:java}// CHECKSTYLE_OFF: RegexpHeader|LineLength{code}
> to disable some precise rules, or even disable every rules with
> {code:java}// CHECKSTYLE_OFF: .*{code}
> can be really useful
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)