This project is currently in Beta
This was forked from danger/kotlin to undergo extensive project maintenance and opinionated changes that felt should stand in its own repository. I don't plan on changing the namespacing of classes, except for artifact targets, to maintain as much compatibility between the two. However, there may be a point at which I deviate from this as the project continues to grow.
Mac - Apple Silicon
brew install r0adkll/tap/danger-kotlin
Mac - Intel
brew install r0adkll/tap/danger-kotlin-intel
Linux
bash <(curl -s https://raw.githubusercontent.com/r0adkll/danger-kotlin/main/scripts/install.sh)
source ~/.bash_profile
This repository boasts an IntelliJ Plugin that you can install to automatically load the custom Danger kotlin script definition into the IDE for syntax highlighting and autocomplete.
Install the latest version via https://plugins.jetbrains.com/plugin/26699-danger-kotlin
or
Directly in your IDE via
Plugins --> Marketplace --> Danger Kotlin
Note
Custom Kotlin script definitions are still a bit wonky in the IDE so sometimes it can take a restart, or another file resolving for it to "settle down"
The plugin will also automatically detect danger(args) {…}
in your Dangerfiles and provide a ▶︎ icon in the gutter for
testing your scripts directly in the IDE
The plugin is also integrates with the built-in GitHub Plugin to automatically detect open PRs for your current branch.
This allows you to run a danger-kotlin pr
command directly from the IDE without having to copy the PR url. It will also
automatically hydrate the runtime environment with the auth token and host/api url information based on the remote you have configured
in git
.
Additionally, it will use git to determine if you are on a branch that is not a base branch (i.e. master
, main
, develop
) and
give you an option to run danger local
against your base.
Danger has prebuilt images that you can use in your workflows
https://github.com/r0adkll/danger-kotlin/pkgs/container/danger-kotlin
In order to import one of those use the docker://
prefix, like so:
jobs:
build:
runs-on: ubuntu-latest
name: "Run Danger"
container:
image: docker://ghcr.io/r0adkll/danger-kotlin:<latest_version>
steps:
- uses: actions/checkout@v4
- name: Run Danger
run: danger-kotlin ci --failOnErrors --no-publish-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
danger-kotlin
was originally developed by @gianluz and @f-meloni @ danger/kotlin
and forked by @r0adkll