gradle-commit-checker-plugin

Gradle plugin to check commits in a branch to avoid large diff in a pull requests

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.github.ksoichiro
ArtifactId

ArtifactId

gradle-commit-checker-plugin
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

gradle-commit-checker-plugin
Gradle plugin to check commits in a branch to avoid large diff in a pull requests
Project URL

Project URL

https://github.com/ksoichiro/gradle-commit-checker-plugin
Source Code Management

Source Code Management

https://github.com/ksoichiro/gradle-commit-checker-plugin

Download gradle-commit-checker-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.ksoichiro/gradle-commit-checker-plugin/ -->
<dependency>
    <groupId>com.github.ksoichiro</groupId>
    <artifactId>gradle-commit-checker-plugin</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.ksoichiro/gradle-commit-checker-plugin/
implementation 'com.github.ksoichiro:gradle-commit-checker-plugin:0.1.1'
// https://jarcasting.com/artifacts/com.github.ksoichiro/gradle-commit-checker-plugin/
implementation ("com.github.ksoichiro:gradle-commit-checker-plugin:0.1.1")
'com.github.ksoichiro:gradle-commit-checker-plugin:jar:0.1.1'
<dependency org="com.github.ksoichiro" name="gradle-commit-checker-plugin" rev="0.1.1">
  <artifact name="gradle-commit-checker-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.ksoichiro', module='gradle-commit-checker-plugin', version='0.1.1')
)
libraryDependencies += "com.github.ksoichiro" % "gradle-commit-checker-plugin" % "0.1.1"
[com.github.ksoichiro/gradle-commit-checker-plugin "0.1.1"]

Dependencies

test (1)

Group / Artifact Type Version
org.ajoberstar : grgit jar 1.4.1

Project Modules

There are no modules declared in this project.

gradle-commit-checker-plugin

Build Status Build status Coverage Status

Gradle plugin to check commits in a branch to avoid large diff in a pull requests.

$ ./gradlew checkCommit
:checkCommit FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':plugin:checkCommit'.
> Your branch includes too much changes. Please check if those changes are not mistake but intentional. If your branch includes multiple features, consider separate them into multiple branches / pull requests.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11.791 secs

Usage

Apply plugin:

plugins {
    id 'com.github.ksoichiro.commit.checker' version '0.1.1'
}

Execute check:

./gradlew checkCommit

Note that this plugin uses git command.
Please install git wherever you execute this task.

If you want to run it on each 'check's, set it to dependent task:

check.dependsOn 'checkCommit'

Configuration

commitChecker {
    // Change this property to the main branch of your project.
    // Default is 'master'.
    mainBranch 'develop'

    // Change this property to the number that is max size you can allow for a pull request size.
    // Default is 1000.
    changedLinesThreshold 100

    // Change this property to true if you want to make the violations to build error.
    // Default is false. (Just showing a message)
    failOnChangesExceedsThreshold true

    // Change this property to whatever you want to show if there are any violations.
    messageForLargeChanges "Too large changes!"

    // Change this property if you want to change
    // the working directory for executing git commands.
    workDir = project.file("foo/bar")
}

License

Copyright 2015 Soichiro Kashima

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
0.1.1
0.1.0