File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/scala/org/scalasteward/core/repoconfig
test/scala/org/scalasteward/core/repoconfig Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ object PullRequestsConfig {
6363 grouping = x.grouping |+| y.grouping,
6464 includeMatchedLabels = x.includeMatchedLabels.orElse(y.includeMatchedLabels),
6565 customLabels = x.customLabels |+| y.customLabels,
66- draft = (x.draft, y.draft).mapN(_ || _)
66+ draft = {
67+ implicit val booleanOrMonoid : Monoid [Boolean ] = Monoid .instance(false , _ || _)
68+ x.draft |+| y.draft
69+ }
6770 )
6871 )
6972}
Original file line number Diff line number Diff line change 11package org .scalasteward .core .repoconfig
22
3+ import cats .implicits .*
34import cats .kernel .laws .discipline .MonoidTests
45import munit .DisciplineSuite
56import org .scalasteward .core .TestInstances .*
67
78class PullRequestsConfigTest extends DisciplineSuite {
89 checkAll(" Monoid[PullRequestsConfig]" , MonoidTests [PullRequestsConfig ].monoid)
10+
11+ test(" global config to use 'draft' PRs should be retained after merging with local config" ) {
12+ val draftTrue = PullRequestsConfig (draft = Some (true ))
13+ val draftUnset = PullRequestsConfig ()
14+ val draftFalse = PullRequestsConfig (draft = Some (false ))
15+
16+ assert((draftTrue |+| draftUnset).draft === Some (true ))
17+ assert((draftTrue |+| draftFalse).draft === Some (true ))
18+ assert((draftUnset |+| draftUnset).draft === None )
19+ }
920}
You can’t perform that action at this time.
0 commit comments