From c0106b42f3518d955da3ea6f2a53b004ee710378 Mon Sep 17 00:00:00 2001 From: Brice Jaglin Date: Tue, 23 Jun 2020 16:46:13 +0200 Subject: [PATCH] re-enable MiMa against latest stable version for published modules * scalafix-cli * scalafix-core * scalafix-interfaces * scalafix-reflect * scalafix-rules * scalafix-testkit --- .github/workflows/ci.yml | 8 +++++ build.sbt | 2 -- project/Mima.scala | 63 +------------------------------------ project/ScalafixBuild.scala | 28 ++++++----------- 4 files changed, 19 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfaaa5645..233731f47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,3 +53,11 @@ jobs: - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v7 - run: ./scalafmt --test + mima: + name: MiMa + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v7 + - run: git fetch --unshallow + - run: sbt +mimaReportBinaryIssues diff --git a/build.sbt b/build.sbt index 9b668d6ac..c3eb4bec7 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,6 @@ def inferJavaHome() = { lazy val interfaces = project .in(file("scalafix-interfaces")) .settings( - noMima, resourceGenerators.in(Compile) += Def.task { val props = new java.util.Properties() props.put("scalafixVersion", version.value) @@ -156,7 +155,6 @@ lazy val testsOutput = project lazy val testkit = project .in(file("scalafix-testkit")) .settings( - noMima, moduleName := "scalafix-testkit", isFullCrossVersion, libraryDependencies ++= Seq( diff --git a/project/Mima.scala b/project/Mima.scala index 480c6776e..4e033c3da 100644 --- a/project/Mima.scala +++ b/project/Mima.scala @@ -4,71 +4,10 @@ import com.typesafe.tools.mima.core._ object Mima { val ignoredABIProblems: Seq[ProblemFilter] = { // To learn more about mima, see: - // See https://github.com/typesafehub/migration-manager/wiki/sbt-plugin#basic-usage + // See https://github.com/lightbend/mima Seq( - // removed semanticdb-sbt - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.Versions.semanticdbSbt"), - // @deprecated - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.Mirror"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.Rewrite"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.ScalafixConfig"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.RewriteCtx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.syntax.package#XtensionSymbolSemanticdbIndex.denotOpt"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.syntax.package#XtensionRefSymbolOpt.symbolOpt"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.sctx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.semanticCtx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.mirror"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleName.withOldName"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleName.generate"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleCtx.matching"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.Rule.andThen"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.SemanticRewrite"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.package$"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.Rewrite"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.package"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.lint.LintCategory.key"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.lint.LintMessage.format"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.patch.PatchOps.rename"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.Mirror"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.Rewrite"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.ScalafixConfig"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.package.RewriteCtx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.syntax.package#XtensionSymbolSemanticdbIndex.denotOpt"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.syntax.package#XtensionRefSymbolOpt.symbolOpt"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.sctx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.semanticCtx"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.SemanticRule.mirror"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleName.withOldName"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleName.generate"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleCtx.matching"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.Rule.andThen"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.SemanticRewrite"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.package$"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.Rewrite"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.rewrite.package"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.lint.LintCategory.key"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.lint.LintMessage.format"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.patch.PatchOps.rename"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.testkit.SemanticRuleSuite.LintAssertion"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.testkit.package$"), - ProblemFilters.exclude[MissingClassProblem]("scalafix.testkit.package"), ProblemFilters.exclude[MissingTypesProblem]("scalafix.testkit.DiffAssertions"), ProblemFilters.exclude[MissingTypesProblem]("scalafix.testkit.SemanticRuleSuite"), - // marked private[scalafix] - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.rule.RuleCtx.printLintMessage"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.rule.RuleCtx.filter"), - ProblemFilters.exclude[IncompatibleMethTypeProblem]("scalafix.patch.Patch.apply"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.patch.Patch.reportLintMessages"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.patch.Patch.lintMessages"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.rule.RuleCtx.printLintMessage"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.rule.RuleCtx.filterLintMessage"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.cli.CliRunner.this"), - ProblemFilters.exclude[FinalClassProblem]("scalafix.util.TokenList"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.util.TokenList.leadingSpaces"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.util.TokenList.trailingSpaces"), - // Other - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.patch.PatchOps.replaceSymbols"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.patch.PatchOps.removeTokens"), ProblemFilters.exclude[Problem]("scalafix.internal.*") ) } diff --git a/project/ScalafixBuild.scala b/project/ScalafixBuild.scala index 596b33bee..eecd9a294 100644 --- a/project/ScalafixBuild.scala +++ b/project/ScalafixBuild.scala @@ -212,12 +212,6 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { s"unit/testOnly -- -l scalafix.internal.tests.utils.SkipWindows" :: s }, - commands += Command.command("mima") { s => - // Disabled until v0.6.0 stable - // "scalafix/mimaReportBinaryIssues" :: - // "scalafix211/mimaReportBinaryIssues" :: - s - }, // There is flakyness in CliGitDiffTests and CliSemanticTests parallelExecution.in(Test) := false, credentials ++= { @@ -289,10 +283,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { ) private val PreviousScalaVersion = Map( - "2.11.12" -> "2.11.11", - "2.12.4" -> "2.12.3", - "2.12.8" -> "2.12.7", - "2.12.10" -> "2.12.8" + "2.13.3" -> "2.13.2" ) override def projectSettings: Seq[Def.Setting[_]] = List( @@ -312,15 +303,16 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { ) ), mimaPreviousArtifacts := { - val previousArtifactVersion = "0.9.6" - // NOTE(olafur) shudder, can't figure out simpler way to do the same. - val binaryVersion = - if (crossVersion.value.isInstanceOf[CrossVersion.Full]) { - val version = scalaVersion.value - PreviousScalaVersion.getOrElse(version, version) - } else scalaBinaryVersion.value + val currentScalaFullV = scalaVersion.value + val previousScalaFullV = + PreviousScalaVersion.getOrElse(currentScalaFullV, currentScalaFullV) + val previousScalaVCrossName = CrossVersion( + crossVersion.value, + previousScalaFullV, + scalaBinaryVersion.value + ).getOrElse(identity[String] _)(moduleName.value) Set( - organization.value % s"${moduleName.value}_$binaryVersion" % previousArtifactVersion + organizationName.value % previousScalaVCrossName % stableVersion.value ) }, mimaBinaryIssueFilters ++= Mima.ignoredABIProblems,