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

ScalafixTestkitPlugin improvements #220

Merged
merged 2 commits into from
May 18, 2021
Merged

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented May 17, 2021

Follows #219

@@ -38,40 +38,41 @@ lazy val tests = projectMatrix
.settings(
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
scalafixTestkitOutputSourceDirectories :=
resolveByInputAxis(output, Compile / unmanagedSourceDirectories).value,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -13,38 +13,42 @@ object ScalafixTestkitPlugin extends AutoPlugin {
override def requires: Plugins = JvmPlugin

object autoImport {
case class InputAxis(scalaVersion: String) extends VirtualAxis.WeakAxis {
case class TestkitTargetAxis(scalaVersion: String)
Copy link
Collaborator Author

@bjaglin bjaglin May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very happy about that name either... I also considered Sources, Fixtures and Data. Suggestions welcome!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already better! Don't have better propositions

@bjaglin bjaglin marked this pull request as ready for review May 17, 2021 16:34
@bjaglin bjaglin requested a review from mlachkar May 17, 2021 18:44
Copy link
Contributor

@mlachkar mlachkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

val project = matrix.finder().apply(sv)
Def.task((project / key).value)
}
private def targetScalaVersion(virtualAxes: Seq[VirtualAxis]): String =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't completely get why we take the first scalaVersion that we find, and use it the resolve task

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we take the first scalaVersion that we find

because there can be only one value per axis per project

use it the resolve task

we lookup the corresponding input/output project based on this value, that's where I am not too satisfied with the Target naming: it's about tagging in tests* which input* or output* it should run against.

@@ -13,38 +13,42 @@ object ScalafixTestkitPlugin extends AutoPlugin {
override def requires: Plugins = JvmPlugin

object autoImport {
case class InputAxis(scalaVersion: String) extends VirtualAxis.WeakAxis {
case class TestkitTargetAxis(scalaVersion: String)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already better! Don't have better propositions

@bjaglin bjaglin merged commit c332bbd into scalacenter:main May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants