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

Add support for Kotlin static analysis using detekt tool

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • 5.0.0-beta1

      There is promising tool for Kotlin static analysis https://github.com/arturbosch/detekt
      It would be great if analysis-collector-plugin added support for it.

      As far as I can tell detekt generates reports in checkstyle format and existing checkstyle plugin already can parse them but it would be better to have separate view for it.

      There is also feature request for detekt itself to add integration with analysis-collector-plugin:
      https://github.com/arturbosch/detekt/issues/219

          [JENKINS-46158] Add support for Kotlin static analysis using detekt tool

          Ulli Hafner added a comment -

          I think it would make more sense to have support in the warnings plug-in? analysis-collector just collects the results from the other static analysis plugins. Or am I missing something?

          Ulli Hafner added a comment - I think it would make more sense to have support in the warnings plug-in? analysis-collector just collects the results from the other static analysis plugins. Or am I missing something?

          Andrei Lapshin added a comment - - edited

          I think it would make more sense to have support in the warnings plug-in? analysis-collector just collects the results from the other static analysis plugins. Or am I missing something?

          I think better option would be to have separate plugin probably based on Checkstyle plugin but having separate UI.

          Because detekt tool supports generation of reports in checkstyle xml format we already can use existing Checkstyle plugin: https://wiki.jenkins.io/display/JENKINS/Checkstyle+Plugin
          to display result using pipeline syntax like

          checkstyle pattern: "$BUILD_DIR/reports/checkstyle/checkstyle.xml, $BUILD_DIR/reports/detekt/detekt.xml"
          

          This approach works fine but if project uses both checkstyle and detekt we will have warnings from different tools in same section which is not ideal.

          I'm sorry if I choose incorrect component when filing this feature request. Feel free to reassign it if there is better suited option.

          Andrei Lapshin added a comment - - edited I think it would make more sense to have support in the warnings plug-in? analysis-collector just collects the results from the other static analysis plugins. Or am I missing something ? I think better option would be to have separate plugin probably based on Checkstyle plugin but having separate UI. Because detekt tool supports generation of reports in checkstyle xml format we already can use existing Checkstyle plugin: https://wiki.jenkins.io/display/JENKINS/Checkstyle+Plugin to display result using pipeline syntax like checkstyle pattern: "$BUILD_DIR/reports/checkstyle/checkstyle.xml, $BUILD_DIR/reports/detekt/detekt.xml" This approach works fine but if project uses both checkstyle and detekt we will have warnings from different tools in same section which is not ideal. I'm sorry if I choose incorrect component when filing this feature request. Feel free to reassign it if there is better suited option.

          Ulli Hafner added a comment -

          I see. So the only requirement for you is to have a separate UI for the warnings? Then this would be automatically available if the improved pipeline support is ready, see wiki for details. There you can also check if all of your requirements are noted.

          Ulli Hafner added a comment - I see. So the only requirement for you is to have a separate UI for the warnings? Then this would be automatically available if the improved pipeline support is ready, see wiki for details. There you can also check if all of your requirements are noted.

          Yes, looks like proposed changes for improved pipeline support will solve this issue.

          Andrei Lapshin added a comment - Yes, looks like proposed changes for improved pipeline support will solve this issue.

          Ulli Hafner added a comment -

          Good to see. So what is missing is just a new parser configuration class (see CheckStyle for an example).

          (Adding such a class is optional. But with such a class you specify labels, icons, default file name, etc. for detekt.
          You even can provide all the descriptions from your web page - if they use the same format as CheckStyle).

          Ulli Hafner added a comment - Good to see. So what is missing is just a new parser configuration class (see CheckStyle for an example). (Adding such a class is optional. But with such a class you specify labels, icons, default file name, etc. for detekt . You even can provide all the descriptions from your web page - if they use the same format as CheckStyle).

            drulli Ulli Hafner
            alapshin Andrei Lapshin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: