From 94cef848654999d6cd395d941d8e19e528566be1 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 18 Apr 2024 17:54:44 +0000 Subject: [PATCH] Use `abstract class`es instead of `trait`s for ADTs --- .../src/main/scala/org/typelevel/sbt/gha/PREventType.scala | 2 +- github-actions/src/main/scala/org/typelevel/sbt/gha/Paths.scala | 2 +- github-actions/src/main/scala/org/typelevel/sbt/gha/Ref.scala | 2 +- .../src/main/scala/org/typelevel/sbt/gha/RefPredicate.scala | 2 +- .../src/main/scala/org/typelevel/sbt/gha/UseRef.scala | 2 +- .../src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala | 2 +- .../main/scala/org/typelevel/sbt/mergify/MergifyAction.scala | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/PREventType.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/PREventType.scala index 6cea47e3..d86dc694 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/PREventType.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/PREventType.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait PREventType extends Product with Serializable +sealed abstract class PREventType extends Product with Serializable object PREventType { val Defaults = List(Opened, Reopened, Synchronize) diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/Paths.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/Paths.scala index bb20c8a8..6d8bb236 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/Paths.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/Paths.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait Paths extends Product with Serializable +sealed abstract class Paths extends Product with Serializable object Paths { final case class Include(paths: List[String]) extends Paths diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/Ref.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/Ref.scala index 248a4ff8..c6c347e0 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/Ref.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/Ref.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait Ref extends Product with Serializable +sealed abstract class Ref extends Product with Serializable object Ref { final case class Branch(name: String) extends Ref diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/RefPredicate.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/RefPredicate.scala index 4d376f19..25ee37e9 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/RefPredicate.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/RefPredicate.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait RefPredicate extends Product with Serializable +sealed abstract class RefPredicate extends Product with Serializable object RefPredicate { final case class Equals(ref: Ref) extends RefPredicate diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/UseRef.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/UseRef.scala index 3bd94538..c9cfb5b5 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/UseRef.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/UseRef.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait UseRef extends Product with Serializable +sealed abstract class UseRef extends Product with Serializable object UseRef { final case class Public(owner: String, repo: String, ref: String) extends UseRef diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala index 0ce06b01..d13dd022 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala @@ -16,7 +16,7 @@ package org.typelevel.sbt.gha -sealed trait WorkflowStep extends Product with Serializable { +sealed abstract class WorkflowStep extends Product with Serializable { def id: Option[String] def name: Option[String] def cond: Option[String] diff --git a/mergify/src/main/scala/org/typelevel/sbt/mergify/MergifyAction.scala b/mergify/src/main/scala/org/typelevel/sbt/mergify/MergifyAction.scala index 5f36afde..547cbc3f 100644 --- a/mergify/src/main/scala/org/typelevel/sbt/mergify/MergifyAction.scala +++ b/mergify/src/main/scala/org/typelevel/sbt/mergify/MergifyAction.scala @@ -142,7 +142,7 @@ object MergifyAction { ) } - private sealed trait OptionallyWeighted + private sealed abstract class OptionallyWeighted private case class Weighted(value: NonEmptyList[(String, Int)]) extends OptionallyWeighted private case class Unweighted(value: NonEmptyList[String]) extends OptionallyWeighted