Skip to content

Commit

Permalink
re-enable MiMa against latest stable version for published modules
Browse files Browse the repository at this point in the history
* scalafix-cli
* scalafix-core
* scalafix-interfaces
* scalafix-reflect
* scalafix-rules
* scalafix-testkit
  • Loading branch information
github-brice-jaglin committed Jun 30, 2020
1 parent 62dc440 commit c0106b4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 82 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -156,7 +155,6 @@ lazy val testsOutput = project
lazy val testkit = project
.in(file("scalafix-testkit"))
.settings(
noMima,
moduleName := "scalafix-testkit",
isFullCrossVersion,
libraryDependencies ++= Seq(
Expand Down
63 changes: 1 addition & 62 deletions project/Mima.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.*")
)
}
Expand Down
28 changes: 10 additions & 18 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++= {
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit c0106b4

Please sign in to comment.