mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-20 08:15:19 +01:00
Fixed handling of failed builds.
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
package com.ysoft.odc
|
||||
|
||||
import com.ysoft.odc.SetDiff.Selection
|
||||
|
||||
|
||||
object SetDiff{
|
||||
sealed abstract class Selection
|
||||
object Selection{
|
||||
case object None extends Selection
|
||||
case object Both extends Selection
|
||||
case object Old extends Selection
|
||||
case object New extends Selection
|
||||
}
|
||||
}
|
||||
|
||||
class SetDiff[T](val oldSet: Set[T], val newSet: Set[T]) {
|
||||
lazy val added = newSet -- oldSet
|
||||
lazy val removed = oldSet -- newSet
|
||||
@@ -11,4 +24,15 @@ class SetDiff[T](val oldSet: Set[T], val newSet: Set[T]) {
|
||||
newSet = newSet.map(f)
|
||||
)
|
||||
|
||||
private def setPair(oldSetBool: Boolean, newSetBool: Boolean) = (oldSetBool, newSetBool) match {
|
||||
case (false, false) => Selection.None
|
||||
case (false, true) => Selection.New
|
||||
case (true, false) => Selection.Old
|
||||
case (true, true) => Selection.Both
|
||||
}
|
||||
|
||||
def whichNonEmpty = setPair(oldSet.nonEmpty, newSet.nonEmpty)
|
||||
|
||||
def whichEmpty = setPair(oldSet.isEmpty, newSet.isEmpty)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user