scapegoat-scala / scapegoat

Scala compiler plugin for static code analysis
Apache License 2.0
529 stars 90 forks source link

JUnit-format report #186

Open panshin opened 7 years ago

panshin commented 7 years ago

I'm trying integrate scapegoat to Atlassian Bamboo CI, but it takes only JUnit-xml reports out of box. JUnit has a simple format, so its implementation will not get a lot of time

https://www.ibm.com/support/knowledgecenter/en/SSQ2R2_9.5.0/com.ibm.rsar.analysis.codereview.cobol.doc/topics/cac_useresults_junit.html

But, may be, there is an easier way to do it?

eugene-sy commented 6 years ago

I'm not sure if it makes a lot of sense. JUnit XML format is written for tests:

<?xml version="1.0" encoding="UTF-8" ?> 
<testsuites id="20140612_170519" name="New_configuration (14/06/12 17:05:19)" tests="225" failures="1262" time="0.001">
    <testsuite id="codereview.cobol.analysisProvider" name="COBOL Code Review" tests="45" failures="17" time="0.001">
       <testcase id="codereview.cobol.rules.ProgramIdRule" name="Use a program name that matches the source file name" time="0.001">
          <failure message="PROGRAM.cbl:2 Use a program name that matches the source file name" type="WARNING">
WARNING: Use a program name that matches the source file name
Category: COBOL Code Review – Naming Conventions
File: /project/PROGRAM.cbl
Line: 2
      </failure>
    </testcase>
  </testsuite>
</testsuites>

The testsuites, testsuite, testcase notations look weird in the scope of static code analysis.

Scapegoat can produce scalastyle-formated reports, the format is similar to the format of checkstyle. There is a plugin for Bamboo: https://bitbucket.org/atlassian/bamboo-checkstyle-plugin ,- it should solve the problem of integration.