Skip to content

Commit bf33bd1

Browse files
authored
Alias dangerJs.DSL in root danger package (#9)
1 parent 0189eb2 commit bf33bd1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ package danger
33
import (
44
"encoding/json"
55
"fmt"
6+
7+
dangerJs "github.com/moolmanruan/danger-go/danger-js"
68
)
79

10+
// DSL wraps the DSL received from danger JS. This allows dangerfiles to only
11+
// import the root danger package.
12+
type DSL = dangerJs.DSL
13+
814
type T struct {
915
results Results
1016
}

cmd/danger-go/runner/runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func buildPlugin(dangerFilePath string) (string, func() error, error) {
105105
return outputFile, clearTempDir, nil
106106
}
107107

108-
type MainFunc = func(d *danger.T, pr dangerJs.DSL)
108+
type MainFunc = func(d *danger.T, pr danger.DSL)
109109

110110
func loadPlugin(libPath string) (MainFunc, error) {
111111
fmt.Println("Loading dangerfile plugin:", libPath)

0 commit comments

Comments
 (0)