Skip to content

Commit

Permalink
CommunitySuite: add Intellij Scala plugin code
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 11, 2024
1 parent 885eb5d commit 8076ea0
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
matrix:
java: [ '11' ]
os: [windows-latest, ubuntu-latest]
group: [Scala2, Scala3, Spark, Other]
group: [Scala2, Scala3, Spark, Intellij, Other]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ lazy val communityTestsSpark = project
.in(file("scalafmt-tests-community/spark")).settings(communityTestsSettings)
.enablePlugins(BuildInfoPlugin).dependsOn(communityTestsCommon)

lazy val communityTestsIntellij = project
.in(file("scalafmt-tests-community/intellij"))
.settings(communityTestsSettings).enablePlugins(BuildInfoPlugin)
.dependsOn(communityTestsCommon)

lazy val communityTestsOther = project
.in(file("scalafmt-tests-community/other")).settings(communityTestsSettings)
.enablePlugins(BuildInfoPlugin).dependsOn(communityTestsCommon)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package org.scalafmt.community.intellij

import org.scalafmt.community.common.CommunityRepoSuite
import org.scalafmt.community.common.TestStats

import scala.meta._

abstract class CommunityIntellijScalaSuite(name: String)
extends CommunityRepoSuite(
"https://github.com/JetBrains/intellij-scala.git",
name,
)

class CommunityIntellijScala_2024_2_Suite
extends CommunityIntellijScalaSuite("intellij-scala-2024.2") {

override protected def builds = Seq(getBuild(
"2024.2.28",
dialects.Scala213,
3469,
excluded = "glob:**/{testdata,testData,resources}/**" :: Nil,
fileOverride = """|{
| "glob:**/sbt/sbt-impl/workspace-entities/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/structure-view/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/repl/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/tasty-reader/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/package-search-client/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/integration/textAnalysis/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/integration/features-trainer/**" {
| runner.dialect = scala33
| }
|}
|""".stripMargin,
))

}

class CommunityIntellijScala_2024_3_Suite
extends CommunityIntellijScalaSuite("intellij-scala-2024.3") {

override protected def builds = Seq(getBuild(
"2024.3.4",
dialects.Scala213,
3475,
excluded = "glob:**/{testdata,testData,resources}/**" :: Nil,
fileOverride = """|{
| "glob:**/sbt/sbt-impl/workspace-entities/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/structure-view/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/repl/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/tasty-reader/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/package-search-client/**" {
| runner.dialect = scala33
| }
| "glob:**/scalac-patches/scalac3-patches/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/integration/textAnalysis/**" {
| runner.dialect = scala33
| }
| "glob:**/scala/integration/features-trainer/**" {
| runner.dialect = scala33
| }
|}
|""".stripMargin,
statsPerStyle = Map(
"classic" -> TestStats.Style(expectedStatesVisited = 5134862),
"classicWithAlign" -> TestStats.Style(expectedStatesVisited = 5139218),
"classicWithRewrites" -> TestStats.Style(expectedStatesVisited = 5134172),
"fold" -> TestStats.Style(expectedStatesVisited = 7953034),
"keep" -> TestStats.Style(expectedStatesVisited = 4737913),
"keepWithAlign" -> TestStats.Style(expectedStatesVisited = 4739065),
"keepWithRewrites" -> TestStats.Style(expectedStatesVisited = 4748954),
"keepWithScalaJS" -> TestStats.Style(expectedStatesVisited = 5167360),
"unfold" -> TestStats.Style(expectedStatesVisited = 5611808),
),
))

}

0 comments on commit 8076ea0

Please sign in to comment.