diff --git a/README.md b/README.md index 2cdec46bc2..ad8972a16e 100644 --- a/README.md +++ b/README.md @@ -197,12 +197,13 @@ To just check the documents, run: ./mill -i docs-tests.test 'sclicheck.DocTests.*' ``` -You can also check all root docs, commands, guides or cookbooks: +You can also check all root docs, commands, reference docs, guides or cookbooks: ```bash ./mill -i docs-tests.test 'sclicheck.DocTests.root*' ./mill -i docs-tests.test 'sclicheck.DocTests.guide*' ./mill -i docs-tests.test 'sclicheck.DocTests.command*' ./mill -i docs-tests.test 'sclicheck.DocTests.cookbook*' +./mill -i docs-tests.test 'sclicheck.DocTests.reference*' ``` Similarly, you can check single files: diff --git a/modules/docs-tests/src/test/scala/sclicheck/DocTests.scala b/modules/docs-tests/src/test/scala/sclicheck/DocTests.scala index c4bb3f4732..db43a57e38 100644 --- a/modules/docs-tests/src/test/scala/sclicheck/DocTests.scala +++ b/modules/docs-tests/src/test/scala/sclicheck/DocTests.scala @@ -1,11 +1,15 @@ package sclicheck class DocTests extends munit.FunSuite { + case class DocTestEntry(name: String, path: os.Path, depth: Int = Int.MaxValue) + val docsRootPath: os.Path = os.pwd / "website" / "docs" - val dirs: Seq[(String, os.Path)] = Seq( - "cookbook" -> docsRootPath / "cookbooks", - "command" -> docsRootPath / "commands", - "guide" -> docsRootPath / "guides" + val entries: Seq[DocTestEntry] = Seq( + DocTestEntry("root", docsRootPath, depth = 1), + DocTestEntry("cookbook", docsRootPath / "cookbooks"), + DocTestEntry("command", docsRootPath / "commands"), + DocTestEntry("guide", docsRootPath / "guides"), + DocTestEntry("reference", docsRootPath / "reference") ) val options: Options = Options(scalaCliCommand = Seq(TestUtil.scalaCliPath)) @@ -19,9 +23,8 @@ class DocTests extends munit.FunSuite { os.read.lines(f).exists(lineContainsAnyChecks) for { - (tpe, dir) <- dirs :+ ("root", docsRootPath) - maxDepth = if dir == docsRootPath then 1 else Int.MaxValue - inputs = os.walk(dir, maxDepth = maxDepth) + DocTestEntry(tpe, dir, depth) <- entries + inputs = os.walk(dir, maxDepth = depth) .filter(_.last.endsWith(".md")) .filter(os.isFile(_)) .filter(fileContainsAnyChecks) diff --git a/website/docs/reference/scala-command/index.md b/website/docs/reference/scala-command/index.md index ffbf610d8d..cb8000a629 100644 --- a/website/docs/reference/scala-command/index.md +++ b/website/docs/reference/scala-command/index.md @@ -18,15 +18,15 @@ There are two recommended ways to test and use Scala CLI: - with brew: -```bash +```bash ignore brew install virtuslab/scala-experimental/scala ``` - with coursier: -```bash +```bash ignore cs setup cs install scala-experimental ← this command will replace the default scala runner ``` -Alternatively, you can rename your `scala-cli` executable or alias it as `scala` \ No newline at end of file +Alternatively, you can rename your `scala-cli` executable or alias it as `scala`