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
Check-link-hygiene bug fix and sbt integration tweak #704
Conversation
when using sbt and `mdoc`, if the checks fail, sbt will exit. this is annoying and this commit is an attempt at solving this issue. To workaround the issue, I include a second main that throws an exception instead
This time, I've actually tested the thing end-to-end (in smithy4s in that case). Also, here is how it looks:
|
@@ -90,7 +90,7 @@ object MdocPlugin extends AutoPlugin { | |||
parsed | |||
).flatten.mkString(" ") | |||
Def.taskDyn { | |||
runMain.in(Compile).toTask(s" mdoc.Main $args") | |||
runMain.in(Compile).toTask(s" mdoc.SbtMain $args") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to add a scripted test to check the regression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, let me look into it
is the name SbtMain
fine for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, whichever is fine. Maybe it's better since it indicates that we are talking about main that should be used for a build tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add scaladoc on top of it + a scripted test that checks --check
and --check-link-hygiene
do not exit but still fail sbt task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Should be run another release ?
Ideally yes, sorry for that |
That's my bad, the check to decide whether to return exit code 1 or 0 is incorrect after my changes for the check-link-hygiene. That is: I returned
Error
when when there were no warnings... Found it while integrating: disneystreaming/smithy4s#472Also, we noticed that when using --check or --check-link-hygiene from sbt, the SBT jvm will exit and it's annoying. To fix that, I introduce a
SbtMain
to be used when calling from a jvm.Happy to rename
SbtMain
because I guess there are other tools (likemill
) that would be calling that.wdyt?