violation-comments-to-github-lib

'Library that adds violation comments from static code analysis to GitHub.'

License

License

Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

se.bjurr.violations
ArtifactId

ArtifactId

violation-comments-to-github-lib
Last Version

Last Version

1.83.1
Release Date

Release Date

Type

Type

jar
Description

Description

violation-comments-to-github-lib
'Library that adds violation comments from static code analysis to GitHub.'
Project URL

Project URL

https://github.com/tomasbjerre/violation-comments-to-github-lib
Source Code Management

Source Code Management

https://github.com/tomasbjerre/violation-comments-to-github-lib

Download violation-comments-to-github-lib

How to add to project

<!-- https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-to-github-lib/ -->
<dependency>
    <groupId>se.bjurr.violations</groupId>
    <artifactId>violation-comments-to-github-lib</artifactId>
    <version>1.83.1</version>
</dependency>
// https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-to-github-lib/
implementation 'se.bjurr.violations:violation-comments-to-github-lib:1.83.1'
// https://jarcasting.com/artifacts/se.bjurr.violations/violation-comments-to-github-lib/
implementation ("se.bjurr.violations:violation-comments-to-github-lib:1.83.1")
'se.bjurr.violations:violation-comments-to-github-lib:jar:1.83.1'
<dependency org="se.bjurr.violations" name="violation-comments-to-github-lib" rev="1.83.1">
  <artifact name="violation-comments-to-github-lib" type="jar" />
</dependency>
@Grapes(
@Grab(group='se.bjurr.violations', module='violation-comments-to-github-lib', version='1.83.1')
)
libraryDependencies += "se.bjurr.violations" % "violation-comments-to-github-lib" % "1.83.1"
[se.bjurr.violations/violation-comments-to-github-lib "1.83.1"]

Dependencies

compile (2)

Group / Artifact Type Version
se.bjurr.violations : violation-comments-lib jar 1.106.1
org.eclipse.mylyn.github : org.eclipse.egit.github.core jar 2.1.5

Project Modules

There are no modules declared in this project.

Violation Comments to GitHub Lib Build Status Maven Central Bintray

This is a library that adds violation comments from static code analysis to GitHub.

It uses Violation Comments Lib and supports the same formats as Violations Lib.

Very easy to use with a nice builder pattern

  violationsToGitHubApi() //
    .withViolations(".*/findbugs/.*\\.xml$", FINDBUGS, rootFolder) //
    .withViolations(".*/checkstyle/.*\\.xml$", CHECKSTYLE, rootFolder) //
    .withUsername("username") // This is Optional!
    .withPassword("password") // This is Optional!
    .usingOAuth2Token("token") // This is Optional!
    .withRepositoryOwner("repositoryOwner")
    .withRepositoryName("repositoryName")
    .withPullRequestId("pullRequestId")
    .toPullRequest();

Authentication can be done by supplying username/password or OAuth2Token in the builder.

Usage

This software can be used:

You may also checkout this blog post that explains how to set it up with Travis.

Travis

To set this up in Travis, you will need to create a GitHub OAuth2 token.

curl -u 'yourgithubuser' -d '{"note":"Violation comments"}' https://api.github.com/authorizations

The token needs to be encrypted before added to your .travis.yml.

sudo apt-get install ruby-dev
gem install travis
travis encrypt export GITHUB_OAUTH2TOKEN=YOUR TOKEN HERE

Now add it to .travis.yml like this.

sudo: false  
language: java  
env:  
  - secure: "YOUR ENCRYPTED TOKEN HERE"
jdk:  
  - oraclejdk7
script:  
  - ./gradlew build violationCommentsToGitHub -DGITHUB_PULLREQUESTID=$TRAVIS_PULL_REQUEST -DGITHUB_OAUTH2TOKEN=$GITHUB_OAUTH2TOKEN -i --stacktrace
notifications:  
  email: false

Here I used Gradle plugin but you can do the same thing with Maven plugin.

Developer instructions

To build the code, have a look at .travis.yml.

To do a release you need to do ./gradlew release and release the artifact from staging. More information here.

Versions

Version
1.83.1
1.82
1.80
1.79
1.78
1.77
1.76
1.75
1.74
1.73
1.72
1.71
1.70
1.69
1.68
1.67
1.66
1.65
1.64
1.63
1.62
1.61
1.60
1.59
1.58
1.57
1.56
1.55
1.54
1.53
1.52
1.51
1.50
1.49
1.47
1.46
1.44
1.43
1.42
1.41
1.40
1.38
1.37
1.36
1.35
1.34
1.33
1.32
1.31
1.30
1.29
1.28
1.27
1.26
1.25
1.24
1.23
1.22
1.21
1.20
1.19
1.18
1.17
1.16
1.15
1.14
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0