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

Request: Publish internal difflib as a micro-library #745

Closed
zainab-ali opened this issue Feb 26, 2024 · 3 comments · Fixed by #756
Closed

Request: Publish internal difflib as a micro-library #745

zainab-ali opened this issue Feb 26, 2024 · 3 comments · Fixed by #756

Comments

@zainab-ali
Copy link

Munit's internal difflib is based on a myers diff algorithm to compare strings.

This produces nice user-friendly diffs, even for large multi-line strings.

It would be great to publish it as a separate library so that it can be used with other testing frameworks. For instance, it could be used alongside weaver without needing to pull in the rest of munit:

libraryDependencies += Seq(
    "org.scalameta" %% "munit-diff" % "munit-version", // only pulls in the difflib
    "com.disneystreaming" %% "weaver-cats" % "weaver-version" // weaver as the actual framework
)

What do you think? If this is feasible, I'd be happy to make a PR to achieve it.

@tgodzik
Copy link
Contributor

tgodzik commented Feb 26, 2024

Thanks for reporting! We've been actually thinking about it since, we do use it in a number of places including Metals and I think scalafmt (or we would want to use it for Scala Native support).

It could even be a separate library altogether:

"org.scalameta" %% "scala-diff" % "version"

I can create a separate repo for it.

@zainab-ali
Copy link
Author

@tgodzik, that would be fantastic! Let me know once you've got the repo at hand and I'll happily help port the code over.

@majk-p
Copy link
Contributor

majk-p commented Mar 25, 2024

We discussed this issue offline with @tgodzik and we decided to implement scala-diff as a separate sbt module in munit. I'll pick this one

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 a pull request may close this issue.

3 participants