-
Notifications
You must be signed in to change notification settings - Fork 4
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
Toolkit: MUnit, os-lib, sttp and upickle tutorials #7
Conversation
- Use you instead of we - Remove Scala-CLI tab on Scala code - Add info about InvalidTestClassError
Tutorial for MUnit async tests.
I think that this article is pretty long and has a complex structure. In my opinion we could add value & perceived simplicity if we tried to make it more concise. I think that we could stick with scala-cli in these examples (while giving some link on installing dependencies to sbt/mill). Then we can avoid having to explain the files structure, we just say that you create that file and it could already have the using directive on top. That way we also get rid of the banner on top. I think I would also get rid of the red banner with the notice about the InvalidTestClassError - I think it could be just a text, I don't perceive it as that important, more of a side-note that may help somebody recover when he creates an object instead. I believe that we also could remove the explanation of the failing test log, as it seems pretty readable on its own. |
complete tutorial for running individual tests
Thanks @szymon-rd for your feedback.
While I agree we should encourage people to use Scala CLI and promote the "simplicity" of Scala CLI, I don't want the many users of sbt to feel that the Toolkit is not made for them. It is indeed easier to use the Toolkit with Scala CLI but it is just a set of libraries: it is not tied to any particular build tool. I want to keep the tabs. They show clearly that we are trying not to divide the community. Also people can easily compare and see that the Scala CLI solution is simpler. Note though that most tutorials will only contain code and no configuration. So most of the time we don't need the Scala CLI/sbt tab. In this regard, the testing tutorial is different. One thing that I need to improve though, is to show the Scala CLI tab by default.
Do you mean we just say to create a file, and that file contains the There are at least 3 ways to create a test file in Scala CLI: the scope directive, the To me the
I don't see how the hyperlink would be better than the dropdown. In both cases, the Scala CLI users can ignore it because they probably know already about the
Agreed.
Sure but also we should not try to make it look simpler than it is. Too simplistic examples with no explanation will create more questions than answers. Where to draw the line between conciseness and over-simplification? There are things that we know implicitly but are far from obvious to other people. While other things can more easily be figured out from the context. In this example, what are the not so obvious things:
The maybe self-evident things:
|
I agree. If the Scala CLI tab is default and short, then it shouldn't be much of a problem to have these different tabs available.
The tests are a bit different indeed. In some other examples, it may be a good option to just write the snippets as if they were scripts with maybe some information present on how to integrate it into a bigger project. In some cases, the self-contained scala-cli scripts may be useful, as long as the reader has the knowledge how to use the solution under different circumstances or knows where to find this information quickly.
I agree, that's a problem where we have to strike the right balance. What I would try to avoid however is introducing many kinds of visually emphasized elements. Seeing the banner on top, a few different types of code snippets, the tabs and the red notice made me lost a bit and I think that other people may feel like it's a bit chaotic too. I think though that removing the failing test output snippet and making the red notice a standard text may help it. |
I think that in the tutorial describing how to run a single test we should describe |
Yes that is the plan. The problem is that |
I talked about it with scala-cli team, it should be implemented soon. |
Adding small tutorial about testing exceptions
Add tutorial on writing assertions
curious about mdoc for the Scala 2 and 3 tabs — in |
Not unless we can figure how to either extend mdoc with a scala 3 modifier , or split markdown files with some regexes |
Perfect! Are we ready to deploy this? |
I have nothing else to add. Should I open the PR to the real docs.scala-lang now? |
I'm not sure about this until VirtusLab/scala-cli#2060 is fixed and released - otherwise munit wont work (with |
That's why I pushed this temporary workaround: a587ace |
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.
I think we can go ahead and make a PR to the scala-lang!
* Add missing redirection from https://docs.scala-lang.org/scala3/book/types-type-classes.html to https://docs.scala-lang.org/scala3/book/ca-type-classes.html * Follow the standard way of labelling a page to be Scala 3 only * Mark “Extension Methods” as Scala 3 specific, and add cross-references with “Implicit Classes”. * Add Scala 2 tabs and explanations in the Implicit Conversions page Remove the detailed explanation from the Tour page in favor of the Book. * Add code tabs to page 'Context Parameters' * Add tabs to Type Classes page * Update intro * Address feedback from review
Here is the final PR: scala#2795 |
[UPDATED]