From 3a057fa009a97a53077e563a2307ffde2703fef3 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:01:00 -0700 Subject: [PATCH] CommunitySuite: support excluding some styles --- .../src/test/scala/org/scalafmt/community/CommunityBuild.scala | 2 ++ .../src/test/scala/org/scalafmt/community/CommunitySuite.scala | 1 + 2 files changed, 3 insertions(+) diff --git a/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunityBuild.scala b/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunityBuild.scala index 5f3a962303..955f736685 100644 --- a/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunityBuild.scala +++ b/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunityBuild.scala @@ -9,4 +9,6 @@ case class CommunityBuild( excluded: List[String], checkedFiles: Int, dialect: sourcecode.Text[Dialect], + styles: Set[String] = Set.empty, + stylesIncluded: Boolean = true, ) diff --git a/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunitySuite.scala b/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunitySuite.scala index d388738913..c9a132b0cd 100644 --- a/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunitySuite.scala +++ b/scalafmt-tests-community/src/test/scala/org/scalafmt/community/CommunitySuite.scala @@ -20,6 +20,7 @@ abstract class CommunitySuite extends FunSuite { for { build <- builds (k, v) <- TestStyles.styles + if build.styles.isEmpty || build.styles.contains(k) == build.stylesIncluded } { val prefix = s"[ref ${build.commit}, style $k]" val style: ScalafmtConfig = v.withDialect(NamedDialect(build.dialect))