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

Provide support for ScalaStyle warnings

    Details

    • Similar Issues:
    • Released As:
      5.0.0-beta2

      Description

      ScalaStyle is a tool fulfilling more or less the same role as CheckStyle. But then for the Scala programming language.

      It seems to piggyback on the format of Checkstyle. An example is provided in this ticket.

      Those warnings are not picked up by the plugin. Presumably because it is a separate file ?

      Merging the warnings into checkstyle-result.xml via scripting in a post-build step does not help either. For some reason the scala files are not shown. Maybe it's because ScalaStyle uses warning id unknown to CheckStyle.

      merged.xml : an example of CheckStyle and ScalaStyle warnings merged into one file. An attempt to sneak in the Scala warnings. Alas, they don't appear.

      scalastyle-output.xml : an example of the warnings ScalaStyle generates.

        Attachments

        1. Bildschirmfoto 2015-03-16 um 22.59.41.png
          Bildschirmfoto 2015-03-16 um 22.59.41.png
          40 kB
        2. merged.xml
          1 kB
        3. pom.xml
          5 kB
        4. scalastyle-output.xml
          56 kB
        5. scalastyle-output.xml
          0.5 kB

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          The problem only occurs with the maven project type, freestyle project should already pick both files. I think it is not possible to merge these files since the maven build type invokes Checkstyle directly after the goal has been finished.

          An additional plug-in is also somewhat an overkill, since the parser still is the same.

          There are two possibilities:

          1. Add a new reporter class responsible for ScalaStyle (This is then an additional post build step with separate configuration). Then there will be two results (and links) available, one for Java and one for Scala.
          2. Aggregate the results. I'm not sure how easy that approach is since I need to load and discard the first action...
          Show
          drulli Ulli Hafner added a comment - The problem only occurs with the maven project type, freestyle project should already pick both files. I think it is not possible to merge these files since the maven build type invokes Checkstyle directly after the goal has been finished. An additional plug-in is also somewhat an overkill, since the parser still is the same. There are two possibilities: Add a new reporter class responsible for ScalaStyle (This is then an additional post build step with separate configuration). Then there will be two results (and links) available, one for Java and one for Scala. Aggregate the results. I'm not sure how easy that approach is since I need to load and discard the first action...
          Hide
          jan_goyvaerts Jan Goyvaerts added a comment -

          I am already doing (2) but wasn't aware one *Style would erase the results of the other one. So I might ask both to dump into separate files and merge manually. I'll have a go at that. At least now the cause is known. However, I have no clue as to how durably fix this really. I guess apply (1).

          What I am surprised though is why the results are erased at the first place. How come CheckStyle erases a file named scalastyle-output.xml ?

          Show
          jan_goyvaerts Jan Goyvaerts added a comment - I am already doing (2) but wasn't aware one *Style would erase the results of the other one. So I might ask both to dump into separate files and merge manually. I'll have a go at that. At least now the cause is known. However, I have no clue as to how durably fix this really. I guess apply (1). What I am surprised though is why the results are erased at the first place. How come CheckStyle erases a file named scalastyle-output.xml ?
          Hide
          drulli Ulli Hafner added a comment -

          My plug-in does not erase anything Checkstyle creates the checkstyle.xml file that is read by my plugin afterwards. After that, Scalastyle creates scalastyle.cml. This file is not read anymore since there is already a result available. So it won't help to merge the results. With the maven project type, you can change the file names of the results since these information is read from the pom.

          Show
          drulli Ulli Hafner added a comment - My plug-in does not erase anything Checkstyle creates the checkstyle.xml file that is read by my plugin afterwards. After that, Scalastyle creates scalastyle.cml. This file is not read anymore since there is already a result available. So it won't help to merge the results. With the maven project type, you can change the file names of the results since these information is read from the pom.
          Hide
          jan_goyvaerts Jan Goyvaerts added a comment -

          Would it help to run the two in separate invocations ? First 'mvn scalastyle:check' followed by 'mvn checkstyle:checkstyle'. As a workaround of course.

          I have no clue how to durably fix this - as I never wrote a Jenkins- or Maven plugin.

          Show
          jan_goyvaerts Jan Goyvaerts added a comment - Would it help to run the two in separate invocations ? First 'mvn scalastyle:check' followed by 'mvn checkstyle:checkstyle'. As a workaround of course. I have no clue how to durably fix this - as I never wrote a Jenkins- or Maven plugin.
          Hide
          drulli Ulli Hafner added a comment -

          Released in 5.0.0-beta2.

          Show
          drulli Ulli Hafner added a comment - Released in 5.0.0-beta2.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              jan_goyvaerts Jan Goyvaerts
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: