Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker instructions and syntax highlighting tips #305

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ danger(args) {

### Setup

### Docker
```sh
docker run --rm -v "${PWD}:/code" -w /code ghcr.io/danger/danger-kotlin:1.3.3 danger-kotlin local
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would theoretically also work without changing the work directory, but the default dir is the root, so mounting the current working directory there could override existing files. Mounting it in a new dir and using that for running the command seems much safer.

```

#### macOS (ARM)
```sh
brew install danger/tap/danger-kotlin
Expand Down Expand Up @@ -130,6 +135,9 @@ You can activate the autocomplete following this additional steps:
- Make sure the script template `DangerFileScript` is active and above the default `Kotlin Script`
- Apply changes
- If opening the `Dangerfile.df.kts` the autocomplete and syntax highlighting doesn't work, try to reboot your IDE or open the Dangerfile from your IDE as a single file.
- If it still doesn't work, go to `Help -> Edit Custom VM Options...` and add `-Dkotlin.script.classpath=<path>/danger-kotlin.jar` (replace the `<path>` with the absolute path to the JAR). Then restart the IDE.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually ran this tool without installing. I got the JAR from the Docker image using

docker run --rm ghcr.io/danger/danger-kotlin:1.3.3 gzip --stdout /usr/local/lib/danger/danger-kotlin.jar | gunzip > danger-kotlin.jar

- You may also need to disable the "K2 mode" (search the settings for it) if you enabled it previously.


### Using external maven dependencies into your Dangerfile
You can use any external dependency by adding the following lines at the top of your `Dangerfile.df.kts`
Expand Down