danger / danger/kotlin

Can't find DangerFileScript in Kotlin Scripting

Open
#276 20 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
542
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Hello people, I am trying to activate the autocomplete, and after adding Script template classes and Script templates classpath
Screenshot 2024-04-12 at 13 19 34

I want to activate DangerFileScript but don't see it in Kotlin Scripting.

Screenshot 2024-04-12 at 13 25 00

I see this cause of errors (Unresolved reference: danger) in my Dangerfile.df.kts

`import systems.danger.kotlin.*

danger(args) {

onGitHub {

    // Big PR Check
    if ((pullRequest.additions ?: 0) - (pullRequest.deletions ?: 0) > 300) {
        warn("Big PR, try to keep changes smaller if you can")
    }

    // Work in progress check
    if (pullRequest.title.contains("WIP", false)) {
        warn("PR is classed as Work in Progress")
    }
}

}`

Am I missing something or doing something wrong?
Thank you very much.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Script template classes and Script templates classpath settings shown in the issue, then inspect the Dangerfile.df.kts example and its unresolved danger reference. Done means the DangerFileScript template is available in Kotlin Scripting, autocomplete works, and the example resolves its imports and danger(args) call.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.