Violation Comments to GitHub1.42Minimum Jenkins requirement: 2.1ID: violation-comments-to-github
You can have a look at violations-test to see what the result may look like.
There is also plugins for:
It supports same formats as Violations Lib:
- RubyCop with `rubycop -f clang file.rb`
- GoVet Same format as GoLint.
- Lint A common XML format, used by different linters.
- PHPMD with `phpmd api.php xml ruleset.xml`
Some formats may vary. Examples of the exact supported formats can be found here.
Missing a format? Open an issue here!
There is also:
You will need to the *pull request id* for the pull request that was built. You may want to have a look at Generic Webhook Trigger plugin or GitHub Pull Request Builder Plugin, it provides the environment variable ghprbPullId.
You must perform the merge before doing the analysis for the lines to match the lines in the pull request.
When installed, a post build action will be available.
The pull request will be commented like this.
This plugin can be used with the Job DSL Plugin. In this example the GitHub Pull Request Builder Plugin is used to trigger, merge and provide environment variables needed.
Here is another example using Generic Webhook Trigger plugin. You will need to add a webhook in GitHub and point it to http://JENKINS_URL/generic-webhook-trigger/invoke. You may want to combine this with HTTP Request Plugin to comment the pull requests with a link to the job. And also Conditional BuildStep Plugin to have different comments depending on build status.