This plugin will add scalastyle static analysis results to Github pull requests built using a GoCD pipeline
- A scala project hosted on Github built using sbt with a dependency on the scalastyle plugin
- A plugin to build pull requests -> https://github.com/ashwanthkumar/gocd-build-github-pull-requests
- Either build the plugin with 'mvn clean install' or download the latest release
- copy the plugin jar file into the go-server plugins/external folder
- Set the go server base URL to use in the trackback link (in /etc/default/go-agent)
- restart the go-server and go-agents
- ensure you have a .github file in the go user's home directory with your authentication details
- create a pipeline with a Github material that will build a repository's pull requests.
- add an 'sbt scalastyle' task to one of the stages
- save all scalastyle-result.xml files as a pipeline artifacts. You will only have 1 unless you have a multi-project sbt build
add a 'Github PR Comment: Scalastyle' task
point the task to the locations of the scalastyle results. If you have a single project build this will tend to be target/scalastyle-result.xml. Otherwise provide a comma separated list of locations. (e.g. server/target/scalastyle-result.xml, client/target/scalastyle-result.xml)
point the task to the folders containing the XML file artifacts (this is needed for the trackback link). For each result file you specified in step 5, specify the matching artifact location as a comma separated list.
When the task executes, the plugin will examine the scalastyle results XML files and comment on the pull request if it found any errors, warning or infos.
You can click on the artifact link to view the raw XML results behind the file summary.