Skip to content

A maven plugin that leaves comment of the result of a "Checkstyle" on github's pull request.

License

Notifications You must be signed in to change notification settings

unchai/checkstyle-github-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkstyle-github-maven-plugin

Build Status

A maven plugin that leaves comment of the result of a "Checkstyle" on github's pull request.

Example

Requirements

  • Maven 3
  • Java 8

Install

<plugins>
    ...
    <plugin>
        <groupId>com.github.unchai</groupId>
        <artifactId>checkstyle-github-maven-plugin</artifactId>
        <version>LATEST_VERSION</version>
        <configuration>
            <configLocation>[Checkstyle configuration file]</configLocation>
        </configuration>
    </plugin>
    ...
</plugins>

Usage

$ mvn checkstyle-github:checkstyle-github \
    -Dgithub.endpoint=<github endpoint url> \
    -Dgithub.token=<github oauth token> \
    -Dgithub.repository=<owner/repositoryname> \
    -Dgithub.pullRequest=<pull request id>

with Jenkinsfile

node {
    stage('lint') {
        if (env.CHANGE_ID) {
            withCredentials([[$class: 'StringBinding', credentialsId: 'github-bot', variable: 'GITHUB_ACCESS_TOKEN']]) {
                sh "'${pwd()}/mvnw' clean checkstyle-github:checkstyle-github" +
                   " -Dgithub.token=${GITHUB_ACCESS_TOKEN}" +
                   " -Dgithub.repository=owner/repo" +
                   " -Dgithub.pullRequest=${env.CHANGE_ID}"
            }
        }
    }
}

License

Apache License 2.0 © 2018 unchai

About

A maven plugin that leaves comment of the result of a "Checkstyle" on github's pull request.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages