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

Turn cookbook recepies into examples #165

Merged
merged 5 commits into from
Oct 7, 2021

Conversation

romanowski
Copy link
Member

No description provided.

docs_checker/check.scala Outdated Show resolved Hide resolved
@@ -1,5 +1,6 @@
// using scala 3.0.2
// using "org.scalameta::munit:0.7.29"
// using com.lihaoyi:ammonite-ops_2.13:2.4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't os-lib (com.lihaoyi::os-lib:0.7.5) be enough? Ammonite-ops is more or less deprecated IIRC.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just pick a random lib, I will change that

catch
case e: Throwable =>
e.printStackTrace()
Seq(TestCase(path, Some(e)))

def checkFile(file: Path) =
def ammPath(p: Path) = os.Path(p.toAbsolutePath)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, this method can be removed if you migrate from Java - Paths.* to os.lib.


val fakeLineMarker = "//fakeline"

def checkFile(file: Path, dest: Option[Path]) =
val content = Files.lines(file).iterator.asScala.toList
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
val content = Files.lines(file).iterator.asScala.toList
val content = os.read.lines(file)

but, you have to replace Path to os.Path

@romanowski romanowski force-pushed the create-examples branch 2 times, most recently from 953c9fb to 8c72bad Compare October 7, 2021 16:22
@romanowski romanowski merged commit 7deb1c7 into VirtusLab:master Oct 7, 2021
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.

None yet

3 participants