Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommunityRepoSuite: add common abstract superclass #4345

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@ package org.scalafmt.community

import scala.meta._

class CommunityMunitSuite extends CommunitySuite {
class CommunityMunitSuite
extends CommunityRepoSuite("https://github.com/scalameta/munit.git", "munit") {

override protected def builds = Seq(
getBuild("v1.0.1", dialects.Scala213, 109),
// latest commit from 30.03.2021
getBuild("06346adfe3519c384201eec531762dad2f4843dc", dialects.Scala213, 102),
)

private def getBuild(
ref: String,
dialect: sourcecode.Text[Dialect],
files: Int,
) = CommunityBuild(
"https://github.com/scalameta/munit.git",
ref,
"munit",
Nil,
files,
dialect,
)

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.scalafmt.community

import scala.meta._

abstract class CommunityRepoSuite(giturl: String, name: String)
extends CommunitySuite {

protected def getBuild(
ref: String,
dialect: sourcecode.Text[Dialect],
files: Int,
) = CommunityBuild(giturl, ref, name, Nil, files, dialect)

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,26 @@ package org.scalafmt.community

import scala.meta._

abstract class CommunityScala2Suite extends CommunitySuite {

protected def getBuild(
name: String,
ref: String,
dialect: sourcecode.Text[Dialect],
files: Int,
): CommunityBuild = CommunityBuild(
"https://github.com/scala/scala.git",
ref,
name,
Nil,
files,
dialect,
)
abstract class CommunityScala2Suite(name: String)
extends CommunityRepoSuite("https://github.com/scala/scala.git", name)

}

class CommunityScala2_11Suite extends CommunityScala2Suite {
class CommunityScala2_11Suite extends CommunityScala2Suite("scala-2.11") {

override protected def builds =
Seq(getBuild("scala-2.11", "v2.11.12", dialects.Scala211, 1286))
Seq(getBuild("v2.11.12", dialects.Scala211, 1286))

}

class CommunityScala2_12Suite extends CommunityScala2Suite {
class CommunityScala2_12Suite extends CommunityScala2Suite("scala-2.12") {

override protected def builds =
Seq(getBuild("scala-2.12", "v2.12.20", dialects.Scala212, 1277))
Seq(getBuild("v2.12.20", dialects.Scala212, 1277))

}

class CommunityScala2_13Suite extends CommunityScala2Suite {
class CommunityScala2_13Suite extends CommunityScala2Suite("scala-2.13") {

override protected def builds =
Seq(getBuild("scala-2.13", "v2.13.14", dialects.Scala213, 1287))
Seq(getBuild("v2.13.14", dialects.Scala213, 1287))

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,29 @@ package org.scalafmt.community

import scala.meta._

abstract class CommunityScala3Suite extends CommunitySuite {

protected def getBuild(
name: String,
ref: String,
dialect: sourcecode.Text[Dialect],
files: Int,
) = CommunityBuild(
"https://github.com/scala/scala3.git",
ref,
name,
Nil,
files,
dialect,
)
abstract class CommunityScala3Suite(name: String)
extends CommunityRepoSuite("https://github.com/scala/scala3.git", name)

}

class CommunityScala3_0Suite extends CommunityScala3Suite {
class CommunityScala3_0Suite extends CommunityScala3Suite("scala-3.0") {

override protected def builds =
Seq(getBuild("scala-3.0", "3.0.2", dialects.Scala30, 698))
override protected def builds = Seq(getBuild("3.0.2", dialects.Scala30, 698))

}

class CommunityScala3_1Suite extends CommunityScala3Suite {
class CommunityScala3_1Suite extends CommunityScala3Suite("scala-3.1") {

override protected def builds =
Seq(getBuild("scala-3.1", "3.1.3", dialects.Scala31, 747))
override protected def builds = Seq(getBuild("3.1.3", dialects.Scala31, 747))

}

class CommunityScala3_2Suite extends CommunityScala3Suite {
class CommunityScala3_2Suite extends CommunityScala3Suite("scala-3.2") {

override protected def builds =
Seq(getBuild("scala-3.2", "3.2.2", dialects.Scala32, 791))
override protected def builds = Seq(getBuild("3.2.2", dialects.Scala32, 791))

}

class CommunityScala3_3Suite extends CommunityScala3Suite {
class CommunityScala3_3Suite extends CommunityScala3Suite("scala-3.3") {

override protected def builds =
Seq(getBuild("scala-3.3", "3.3.3", dialects.Scala33, 861))
override protected def builds = Seq(getBuild("3.3.3", dialects.Scala33, 861))

}
Loading