Skip to content

Commit c1c36b5

Browse files
committed
Initialize settings and keys to zero like values in globalSettings
1 parent 7aac533 commit c1c36b5

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

src/main/scala/com/hpe/sbt/ValidatePullRequest.scala

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,35 @@ object ValidatePullRequest extends AutoPlugin {
132132
private lazy val travisPullRequestId = sys.env.get(TravisPullIdEnvVarName).filterNot(_ == "false").map(_.toInt)
133133
private lazy val pullRequestId = jenkinsPullRequestId orElse travisPullRequestId
134134

135-
override lazy val buildSettings = Seq(
136-
validatePullRequest / includeFilter := "*",
137-
validatePullRequest / excludeFilter := "README.*",
138-
validatePullRequestBuildAll / includeFilter := PathGlobFilter("project/**") || PathGlobFilter("*.sbt"),
139-
validatePullRequestBuildAll / excludeFilter := NothingFilter,
135+
override lazy val globalSettings = Seq(
136+
validatePullRequest := (),
137+
validatePullRequestBuildAll := (),
140138
prValidatorSourceBranch := {
141139
localSourceBranch orElse jenkinsSourceBranch getOrElse "HEAD"
142140
},
143141
prValidatorTargetBranch := {
144142
localTargetBranch orElse jenkinsTargetBranch orElse travisTargetBranch getOrElse "origin/main"
145143
},
144+
prValidatorTasks := Nil,
145+
prValidatorBuildAllTasks := Nil,
146+
prValidatorEnforcedBuildAllTasks := Nil,
146147
prValidatorGithubEndpoint := uri("https://api.github.com"),
147148
prValidatorGithubRepository := sys.env.get(TravisRepoName),
148149
prValidatorBuildAllKeyword := """PLS BUILD ALL""".r,
150+
prValidatorGithubEnforcedBuildAll := false,
151+
prValidatorTravisNonPrEnforcedBuildAll := {
152+
sys.env.get(TravisPullIdEnvVarName).contains("false")
153+
},
154+
prValidatorEnforcedBuildAll := false,
155+
prValidatorChangedProjects := Changes(allBuildMatched = false, Set.empty),
156+
prValidatorProjectBuildTasks := Nil
157+
)
158+
159+
override lazy val buildSettings = Seq(
160+
validatePullRequest / includeFilter := "*",
161+
validatePullRequest / excludeFilter := "README.*",
162+
validatePullRequestBuildAll / includeFilter := PathGlobFilter("project/**") || PathGlobFilter("*.sbt"),
163+
validatePullRequestBuildAll / excludeFilter := NothingFilter,
149164
prValidatorGithubEnforcedBuildAll := {
150165
val log = streams.value.log
151166
val buildAllMagicPhrase = prValidatorBuildAllKeyword.value
@@ -183,9 +198,6 @@ object ValidatePullRequest extends AutoPlugin {
183198
}
184199
}
185200
},
186-
prValidatorTravisNonPrEnforcedBuildAll := {
187-
sys.env.get(TravisPullIdEnvVarName).contains("false")
188-
},
189201
prValidatorEnforcedBuildAll := prValidatorTravisNonPrEnforcedBuildAll.value || prValidatorGithubEnforcedBuildAll.value,
190202
prValidatorChangedProjects := {
191203
val log = streams.value.log

0 commit comments

Comments
 (0)