-
Notifications
You must be signed in to change notification settings - Fork 28
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
Doctests of package objects are in the wrong package #120
Comments
this was probably introduced by me when I migrated to scalameta. Will try to fix it |
members of package objects got correct package name (fixes #120)
Thanks for the quick fix and release, @jozic and @tkawachi. Your fix worked but it seems that I'm now hitting another wall. The build log suggests that there is a conflict between sbt-scalafmt and sbt-doctest wrt to Scalameta. I've no idea what is going on there. |
looks like sbt-scalafmt also brings scalameta, but super old one (at least version wise) - 1.7.0. Sbt-doctest is also a plugin, so i believe they share classpath
cc @olafurpg any other ideas? |
It's a shame that sbt forces all plugins on the same classpath. Even if everyone use the latest scalameta version and we never introduce a binary breaking change again you will still encounter runtime classpath exceptions when parsing files with XML literals due to sbt/zinc#546 I'm afraid that the only robust way to bring in a dependency like Scalameta into an sbt plugin is to fetch the artifacts of your library and classload. Here is a write-up about the problem https://docs.google.com/document/d/1Y1MVMjVQ8P25YEI3uvh86gg3n61WZng0hr1qRUS_S6I/edit# We use this approach in sbt-scalafix https://github.com/scalacenter/sbt-scalafix/blob/b66445a78d1335d166e09cbce56ff07c636613e0/src/main/scala/scalafix/sbt/ScalafixPlugin.scala#L186-L191 The steps are roughly
I'm happy to give more guidance on this approach. It may seem like a lot of ceremony but I personally found it very helpful to write and document the interfaces module. Having spent almost 3 years writing sbt plugins that use scalameta I believe this is the only way to do it correctly. |
@fthomas can you try using scalafmt |
@jozic Yes, that worked. fthomas/refined#559 is now green. |
I tried to upgrade sbt-doctest from 0.8.0 to 0.9.1 in refined but the Doctest of this package object fails to compile because it is now in a different package.
Here is the Doctest generated by 0.8.0:
and this is what 0.9.1 generates:
The difference between these two that to causes the compilation failure is in the first line:
I think the behaviour of 0.8.0 with regards to package objects should be restored.
The text was updated successfully, but these errors were encountered: