Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-301

Plugin in check goal should print the name of the rule that was violated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0
    • None
    • None

    Description

      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".

      [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.
      

      So after the changes it could be (only the relevant part):

      .../project/src/main/java/com/implementation/sds/util/DatesCalculator.java:12 (AvoidStarImport) Using the '.*' form of import should be avoided - java.util.*.
      

      This name is usefull if one would like to disable this check using suppression plugin:

          <module name="SuppressWithNearbyCommentFilter">
              <property name="commentFormat" value="@checkstyle (\w+) \((\d+) lines?\)"/>
              <property name="checkFormat" value="$1"/>
              <property name="influenceFormat" value="$2"/>
          </module>
      

      Right now googling is required to find out the name of the rule.

      Attachments

        Activity

          People

            gboue Guillaume Boué
            krzyk Krzysztof Krason
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: