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

bugfix: [Scala 3] Reset context before each fail section #664

Merged
merged 1 commit into from Jul 13, 2022

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jul 11, 2022

Previously, we were using the same reporter for each fail section, which was causing no more errors to be reported on the next section.

Now, we reset the context before compiling, which is creating a new reporter each time and that was already done for compile

I also tidied it a bit to only use the currently available context which will be fresh on reset always.

Fixes #663

@tgodzik tgodzik requested a review from keynmol July 11, 2022 17:34
Previously, we were using the same reporter for each fail section, which was causing no more errors to be reported on the next section.

Now, we reset the context before compiling, which is creating a new reporter each time and that was already done for `compile`

I also tidied it a bit to only use the currently available context which will be fresh on `reset` always.

Fixes scalameta#663
Copy link
Collaborator

@keynmol keynmol left a comment

Choose a reason for hiding this comment

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

Nice!

@tgodzik tgodzik merged commit 9711156 into scalameta:main Jul 13, 2022
@tgodzik tgodzik deleted the reset-fail branch July 13, 2022 09:26
@erikerlandson
Copy link

@tgodzik thanks!

cc @armanbilge

@erikerlandson
Copy link

@tgodzik is there an ETA on when this fix will appear in a release? It's not a blocker for me, but I was hoping to eventually use failures in my coulomb mdoc, because what it forbids (compile failure) is often as significant as what it allows.
cc @armanbilge

@armanbilge
Copy link
Contributor

@erikerlandson in the meantime you should be able to use the snapshot. I think this is the right config:

Inside project/plugins.sbt:

resolvers ++= Repository.sonatypeOssRepos("snapshots")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2+48-c5215673-SNAPSHOT")

In build.sbt:

ThisBuild / resolvers ++= Repository.sonatypeOssRepos("snapshots")

@erikerlandson
Copy link

@armanbilge thanks, I'll give that a try 👍

@erikerlandson
Copy link

I think this is working 🎉

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.

mdoc:fail blocks are displaying incorrect error results
4 participants