Skip to content

AckeeCZ/danger-kotlin-ackee-conventions

Repository files navigation

Maven Central

danger-kotlin Ackee conventions plugin

This is a plugin for danger-kotlin that checks various Ackee conventions like if commit messages align with recommendations specified e.g. here, if commits contain ticket references, etc.

Although this plugin is open for general use, it’s primarily designed as an internal tool to help us share Danger conventions checking logic across our Ackee projects. Because of that, conventions are intentionally not exposed to public contracts as we might change them anytime to suit our internal workflows. Although this plugin is probably not suitable for third-party use, it can still be used as a reference for implementing similar conventions in your own Danger files.

Installation

Put

@file:DependsOn("io.github.ackeecz:danger-kotlin-ackee-conventions:x.y.z")

to the top of your Dangerfile

Usage

There is a single method AckeeConventionsPlugin.check that will perform validations on the merge request.

fun DangerDSL.checkConventions() {
    onGitLab {
        AckeeConventionsPlugin.check(
            data = MergeRequestData(
                title = mergeRequest.title,
                description = mergeRequest.description,
                createdFiles = git.createdFiles,
                modifiedFiles = git.modifiedFiles,
                commits = git.commits.map { Commit(message = it.message, sha = it.sha) },
            ),
        )
    }
}

About

Danger Kotlin Plugin with Ackee conventions

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages