Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20460

Set "tagSeverity" to "info" but Jenkins-checkstyle reports "warning"

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: checkstyle-plugin
    • Labels:
      None
    • Environment:
      Mac OS X 10.7.5,Jenkins-Checkstyle 3.35
    • Similar Issues:

      Description

      checkstyle rules contains warning:

      <module name="WriteTag">
      <property name="tag" value="@author"/>
      <property name="tagFormat" value="\S"/>
      </module>

      Expect result:

      If I do not configure the "tagSeverity" property ,its default value is "info",but the checkdtyle-plugin reports "warning"

      Actually:

      But when I use the Jenkins-Checkstyle ,this plugin reports "warning" as following in Jenkins log:

      Successfully parsed file D:\JENKINS_hzqa_CI\workspace\daggerMaster-Checkstyle\checkstyle\checkstyle_result.xml of module with 23 warnings.

      But the checkstyle-result.xml shows severity="info" not "warning"

      I want to know why the severity is "info" but plugin reports me "warning".This maybe a bug of this plugin,would it?

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          I don't understand the problem. Can you please elaborate? What is the expected behavior? Can you please attach your checkstyle.xml file (that contains the warnings?).

          Show
          drulli Ulli Hafner added a comment - I don't understand the problem. Can you please elaborate? What is the expected behavior? Can you please attach your checkstyle.xml file (that contains the warnings?).
          Hide
          andrewleo andrew leo added a comment - - edited

          I mean when I don't configure the "tagSeverity" property,the default value should be "info".But this plugin report "warning" as the screenshot shows.I don't know the reason.
          or it means not matter what "tagSeverity" is,except “ignore”,this plugin will always report "warning"?

          Show
          andrewleo andrew leo added a comment - - edited I mean when I don't configure the "tagSeverity" property,the default value should be "info".But this plugin report "warning" as the screenshot shows.I don't know the reason. or it means not matter what "tagSeverity" is,except “ignore”,this plugin will always report "warning"?
          Hide
          andrewleo andrew leo added a comment - - edited

          Sorry for not expressing myself clearly.
          I mean, you can find in the screenshots, that the right screenshot(checkstyle_result.xml) shows that "severity" is "info" ,but as the left one(Jenkins console) showing ,checkstyle-plugin reports "23 warning",does the plugin parses "info" into "warning" uncorrectly?

          the checkstyle.xml likes this:

          <module name="WriteTag">
          <property name="tag" value="@author"/>
          <property name="tagFormat" value="\S"/>
          </module>

          Wish your reply,many thanks!

          Show
          andrewleo andrew leo added a comment - - edited Sorry for not expressing myself clearly. I mean, you can find in the screenshots, that the right screenshot(checkstyle_result.xml) shows that "severity" is "info" ,but as the left one(Jenkins console) showing ,checkstyle-plugin reports "23 warning",does the plugin parses "info" into "warning" uncorrectly? the checkstyle.xml likes this: <module name="WriteTag"> <property name="tag" value="@author"/> <property name="tagFormat" value="\S"/> </module> Wish your reply,many thanks!
          Hide
          drulli Ulli Hafner added a comment - - edited

          Thanks for clarifying. The checkstyle plug-in (as all plug-ins based on analysis-core) do support only warnings. So each error tag in checkstyle is converted to a warning. The priority is determined using

          if ("error".equalsIgnoreCase(error.getSeverity())) {
              priority = Priority.HIGH;
          }
          else if ("warning".equalsIgnoreCase(error.getSeverity())) {
              priority = Priority.NORMAL;
          }
          else if ("info".equalsIgnoreCase(error.getSeverity())) {
              priority = Priority.LOW;
          }
          
          Show
          drulli Ulli Hafner added a comment - - edited Thanks for clarifying. The checkstyle plug-in (as all plug-ins based on analysis-core) do support only warnings. So each error tag in checkstyle is converted to a warning. The priority is determined using if ( "error" .equalsIgnoreCase(error.getSeverity())) { priority = Priority.HIGH; } else if ( "warning" .equalsIgnoreCase(error.getSeverity())) { priority = Priority.NORMAL; } else if ( "info" .equalsIgnoreCase(error.getSeverity())) { priority = Priority.LOW; }
          Hide
          andrewleo andrew leo added a comment -

          Thank you for patiently explaining!
          I have make this situation clearly,and you can close this issue while it is not a bug.
          many Thanks!

          Show
          andrewleo andrew leo added a comment - Thank you for patiently explaining! I have make this situation clearly,and you can close this issue while it is not a bug. many Thanks!

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              andrewleo andrew leo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: