From 76a95fed8acf1e4a65a347e75c647da6648cba56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 1 Nov 2023 14:28:44 +0100 Subject: [PATCH 1/3] Clear the MiMa filters. --- build.sbt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/build.sbt b/build.sbt index d0c62751..482411a4 100644 --- a/build.sbt +++ b/build.sbt @@ -114,18 +114,6 @@ lazy val tastyQuery = Seq( // Everything in tastyquery.reader is private[tastyquery] at most ProblemFilters.exclude[Problem]("tastyquery.reader.*"), - - // private[tastyquery], not an issue - ProblemFilters.exclude[IncompatibleMethTypeProblem]("tastyquery.Symbols#ClassSymbol.createRefinedClassSymbol"), - ProblemFilters.exclude[DirectMissingMethodProblem]("tastyquery.Symbols#ClassSymbol.createRefinedClassSymbol"), - ProblemFilters.exclude[DirectMissingMethodProblem]("tastyquery.Types#PolyType.fromParamsSymbols"), - ProblemFilters.exclude[DirectMissingMethodProblem]("tastyquery.Types#TypeLambda.fromParamsSymbols"), - ProblemFilters.exclude[DirectMissingMethodProblem]("tastyquery.Types#TypeLambdaTypeCompanion.fromParamsSymbols"), - - // New abstract methods in a completely sealed hierarchy, not an issue - ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("tastyquery.Trees#*.canEqual"), - ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("tastyquery.Trees#*.productArity"), - ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("tastyquery.Trees#*.productElement"), ) }, ) From 3a3cd38d39ba1893268c874feda9ad5077ae05db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 1 Nov 2023 15:23:02 +0100 Subject: [PATCH 2/3] Set up TASTy-MiMa. --- .github/workflows/scala.yml | 2 ++ build.sbt | 8 ++++++++ project/plugins.sbt | 2 ++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index fcdca63e..011e5cc7 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -35,3 +35,5 @@ jobs: run: sbt scalafmtCheck - name: Run version policy check run: sbt versionPolicyCheck + - name: Run TASTy-MiMa + run: sbt tastyMiMaReportIssues diff --git a/build.sbt b/build.sbt index 482411a4..167c8615 100644 --- a/build.sbt +++ b/build.sbt @@ -116,6 +116,14 @@ lazy val tastyQuery = ProblemFilters.exclude[Problem]("tastyquery.reader.*"), ) }, + + tastyMiMaPreviousArtifacts := mimaPreviousArtifacts.value, + tastyMiMaConfig ~= { prev => + prev + .withMoreArtifactPrivatePackages(java.util.Arrays.asList( + "tastyquery", + )) + }, ) .jvmSettings( fork := true, diff --git a/project/plugins.sbt b/project/plugins.sbt index 5446ea47..91dba41a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,3 +4,5 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.4") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "2.1.0") + +addSbtPlugin("ch.epfl.scala" % "sbt-tasty-mima" % "0.5.0") From 17729976ec54e710b71fdd889bce41b6649dde02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Wed, 1 Nov 2023 15:34:08 +0100 Subject: [PATCH 3/3] Update the readme. In particular, remove the notice that tasty-query is still in development and likely buggy. It is now stable. --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5164e7ec..3c4d5e04 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,6 @@ Its API allows users to query semantic information about the project: In addition, for Scala 3 code, it provides access to the full Trees, allowing for deeper inspection of the code. -TASTy Query is still in development, so it is not unlikely that you will encounter bugs. -Feel free to file them in our bug tracker. -Nevertheless, it should already be usable for the most part. - ## Usage Add the following dependency to your build: @@ -28,12 +24,12 @@ libraryDependencies += "ch.epfl.scala" %% "tasty-query" % "" You can find the latest release in the Releases list on GitHub. Head over to the [latest API docs](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery.html) to see what's available. -To get started, create a [`Classpath`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Classpaths$$Classpath.html) using [`ClasspathLoaders.read`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/jdk/ClasspathLoaders$.html). +To get started, create a [`Classpath`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Classpaths$.html) using [`ClasspathLoaders.read`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/jdk/ClasspathLoaders$.html). Please note that TASTy Query requires that all classes, such as the JRE, must be explicitly added to the classpath. On the JDK versions >= 9, the JRE classpath can be obtained on the JVM platform with `FileSystems.getFileSystem(java.net.URI.create("jrt:/")).getPath("modules", "java.base")`. On the JavaScript plaform the contents of this path need to be saved as a JAR file in the real file system. -Then, create a [`Context`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Contexts$$Context.html) object using [`Contexts.init(classpath)`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Contexts$.html#init-fffffe7c). -From there, follow the available methods to access [`Symbols`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Symbols$.html), [`Types`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Types$.html) and [`Trees`](https://javadoc.io/doc/ch.epfl.scala/tasty-query_3/latest/tastyquery/Trees$.html). +Then, create a [`Context`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Contexts$$Context.html) object using [`Context.initialize(classpath)`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Contexts$$Context$.html#initialize-a22). +From there, follow the available methods to access [`Symbols`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Symbols$.html), [`Types`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Types$.html) and [`Trees`](https://javadoc.io/page/ch.epfl.scala/tasty-query_3/latest/tastyquery/Trees$.html). ## Motivation @@ -81,7 +77,7 @@ There are several reasons for that, including the following: Reading TASTy files is therefore complex, and requires a full classpath to make sense of it. The product is a multi-dimensional graph involving symbols, trees and types. -tasty-query's job is to read TASTy files for you, and present the information it contains (explicitly or implicitly) in as convenient way as possible. +tasty-query's job is to read TASTy files for you, and present the information it contains (explicitly or implicitly) in as convenient a way as possible. ## Use cases