maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Boué (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MCHECKSTYLE-301) Plugin in check goal should print the name of the rule that was violated
Date Sun, 12 Feb 2017 18:54:41 GMT

    [ https://issues.apache.org/jira/browse/MCHECKSTYLE-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15862915#comment-15862915
] 

Guillaume Boué commented on MCHECKSTYLE-301:
--------------------------------------------

Those log lines come directly from Checkstyle. There was a feature request for this on Checkstyle
GitHub (see https://github.com/checkstyle/checkstyle/issues/2666), and it has been implemented
in 6.14. Considering we're updating to version 6.18 in version 3.0.0 of the plugin, this enhancement
will also be available by default.

In this case, the result looks like

{noformat}
.../project/src/main/java/com/implementation/sds/util/DatesCalculator.java:12 Using the '.*'
form of import should be avoided - java.util.*. [AvoidStarImport]
{noformat}

> Plugin in check goal should print the name of the rule that was violated
> ------------------------------------------------------------------------
>
>                 Key: MCHECKSTYLE-301
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-301
>             Project: Maven Checkstyle Plugin
>          Issue Type: Bug
>            Reporter: Krzysztof Krason
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> Right now the plugin prints the name of file, line number and description of the violation,
it would be nice to also have a violation ID/name.
> In the case below it should print "AvoidStarImport".
> {code}
> [INFO] --- maven-checkstyle-plugin:2.15:check (check-sources) @ svt-sds-impl ---
> [INFO] Starting audit...
> .../project/src/main/java/com/implementation/sds/util/DatesCalculator.java:12: Using
the '.*' form of import should be avoided - java.util.*.
> Audit done.
> {code}
> So after the changes it could be (only the relevant part):
> {code}
> .../project/src/main/java/com/implementation/sds/util/DatesCalculator.java:12 (AvoidStarImport)
Using the '.*' form of import should be avoided - java.util.*.
> {code}
> This name is usefull if one would like to disable this check using suppression plugin:
> {code}
>     <module name="SuppressWithNearbyCommentFilter">
>         <property name="commentFormat" value="@checkstyle (\w+) \((\d+) lines?\)"/>
>         <property name="checkFormat" value="$1"/>
>         <property name="influenceFormat" value="$2"/>
>     </module>
> {code}
> Right now googling is required to find out the name of the rule.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message