BartyCrouch
BartyCrouch copied to clipboard
Add integration with Jenkins CI
Jenkins plugin Warnings NG can read checkstyle reports about found issues. Is it possible to add such reporting format for BartyCrouch to get reports integrated in Jenkins CI build results?
this format is used for example in Swiftlint project
@nysander Thanks for this suggestion!
Could you please link to a documentation and an example of what the output should look like?
We could solve this by simply adding a new case named something like jenkins
(or the format name) to the OutputFormatTarget
enum here. Then, by adding a new option here similar to the already existing --xcode-output
there could be something like --jenkins-output
that you would be using when you need it on the CI.
Having outlined the way of how this could be tackled, feel free to post a PR with the changes needed to get this running. Otherwise you might need to wait a little longer until I have time to look into this.
I do have almost any knowledge about this 😉 but I have found that swiftlint uses checkstyle report format which is parsable via this plugin without much problems. I have yesterday rewrited this reporter and added for IBLinter project and made PR to test it on live jenkins if merged as I have no knowledge how to force jenkins use it without cocoapods.
IBLinter and SwiftLint uses --reporter ... format for different exports. format name should be checkstyle as this is XML format to which we must conform here - this format is not Jenkins' only format. Here you have example XML from IBLinter exported error:
updated file: test.xml.zip
reporter from IBLinter rewritten from SwiftLint one by myself: https://github.com/nysander/IBLinter/blob/checkstyle/Sources/IBLinterKit/Reporters/CheckstyleReporter.swift - not merged back to original project yet reporter from SwiftLint: https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Reporters/CheckstyleReporter.swift
@nysander Sorry for getting back to you so late. I think a different output format can be implemented quite easily, just add a new option like we already have the -x
option for Xcode compatible output, then add a case in this enum and implement the output file parser. I'd love to review and merge a PR adding this feature. :)
thanks for feedback :) I will look at it but cannot tell you the timeframe now unfortunately