Hi there,
I just cloned the repository, compiled and I was generating the site running doc/makeMicrosite, but I got quite some errors. Mainly about non-exhaustive pattern matching. I paste the errors in here, without all the output. Does anyone knows why? Am I doing something wrong?
Thank you in advance for your help
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:45
// <console>:21: warning: match may not be exhaustive.
// It would fail on the following inputs: Leaf, Node(_, _, _)
// def map[A, B](tree: Tree[A])(f: A => B) = tree match {
// ^
// error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:48: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:64: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:79: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:106: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:157: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/typeclasses/lawtesting.md:174: incomplete input in code block, missing brace or paren?
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:271
<console>:24: warning: match may not be exhaustive.
It would fail on the following inputs: Closed, Open
doorState match {
^
error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:286: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:295: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:304: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:310: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/state.md:314: incomplete input in code block, missing brace or paren?
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/either.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/either.md:333
<console>:28: warning: match may not be exhaustive.
It would fail on the following inputs: Left(Database(_)), Left(Service(_))
doApp match {
^
error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/either.md:347: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/either.md:356: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/either.md:362
// <console>:13: error: illegal start of simple expression
// val either: Either[Throwable, Int] = Either.catchNonFatal("abc".toInt)
// ^
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:202
<console>:33: warning: match may not be exhaustive.
It would fail on the following inputs: Delete(_), Get(_), Put(_, _)
fa match {
^
error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:256: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:287: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:295: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:310: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:322: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:328: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:350: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:366: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:373: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:397: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:403: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:407: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:560: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freemonad.md:620: incomplete input in code block, missing brace or paren?
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/const.md
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:69
<console>:30: warning: match may not be exhaustive.
It would fail on the following inputs: HasNumber, Size(_)
fa match {
^
error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:75: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:112: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:136: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:142: incomplete input in code block, missing brace or paren?
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/freeapplicative.md:164: incomplete input in code block, missing brace or paren?
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/eithert.md
[tut] compiling: /home/benkio/workspace/cats/docs/src/main/tut/datatypes/contt.md
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/contt.md:163
// <console>:21: warning: match may not be exhaustive.
// It would fail on the following inputs: Failed, Succeeded(_)
// userUpdateResult match {
// ^
// error: No warnings can be incurred under -Xfatal-warnings.
[tut] *** Error reported at /home/benkio/workspace/cats/docs/src/main/tut/datatypes/contt.md:175: incomplete input in code block, missing brace or paren?
[error] (run-main-0) tut.TutException: Tut execution failed.
[error] stack trace is suppressed; run last docs / tut for the full output
[error] stack trace is suppressed; run last docs / tut for the full output
[error] (docs / tut) Nonzero exit code: 1
[error] Total time: 105 s (01:45), completed 09-Sep-2020 16:21:57
sbt:cats>
Yes, I got the same, I am wanting to update with ApplicativeError and MonadError. There is a #2927 which will replace tut with mdoc. As soon as that is updated we probably will have a better experience with docs. ;)
@benkio can you try again on latest master? #2927 has just been merged and should make things better
That's a great news, thank you.
Just tried right now and I got no errors, BUT, the generated microsite seems to have problems linking the resources!
I paste in here the commands I run, the output and the screenshot of the site (without css and resources)
I followed the instructions in here: https://github.com/typelevel/cats/blob/master/CONTRIBUTING.md#generating-the-site
Plus I also run a rm -rf cats-doc/ + git pull origin master and an sbt clean. Just to be sure to be using the project at its bare metal.
So, either I do something wrong (very likely) or we need to update/extend the guide
~/workspace/cats$ git pull origin master
From github.com:typelevel/cats
* branch master -> FETCH_HEAD
Already up-to-date.
~/workspace/cats$ sbt --supershell=false clean
[info] welcome to sbt 1.3.13 (Private Build Java 1.8.0_265)
[info] loading settings for project cats-build from build.sbt,plugins.sbt ...
[info] loading project definition from /home/benkio/workspace/cats/project
[info] loading settings for project cats from build.sbt,version.sbt ...
[info] resolving key references (28810 settings) ...
[info] set current project to cats (in build file:/home/benkio/workspace/cats/)
[success] Total time: 0 s, completed 12-Sep-2020 12:31:25
~/workspace/cats$ rm -rf cats-docs/
~/workspace/cats$ sbt --supershell=false docs/makeMicrosite
[info] welcome to sbt 1.3.13 (Private Build Java 1.8.0_265)
[info] loading settings for project cats-build from build.sbt,plugins.sbt ...
[info] loading project definition from /home/benkio/workspace/cats/project
[info] loading settings for project cats from build.sbt,version.sbt ...
[info] resolving key references (28810 settings) ...
[info] set current project to cats (in build file:/home/benkio/workspace/cats/)
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 87 Scala sources to /home/benkio/workspace/cats/kernel/.jvm/target/scala-2.12/classes ...
[info] Done compiling.
[info] Compiling 36 Scala sources to /home/benkio/workspace/cats/kernel-laws/jvm/target/scala-2.12/classes ...
[info] Compiling 215 Scala sources to /home/benkio/workspace/cats/core/.jvm/target/scala-2.12/classes ...
[info] Done compiling.
[info] Done compiling.
[info] Compiling 10 Scala sources to /home/benkio/workspace/cats/free/.jvm/target/scala-2.12/classes ...
[info] Compiling 111 Scala sources to /home/benkio/workspace/cats/laws/.jvm/target/scala-2.12/classes ...
[info] Done compiling.
[info] Done compiling.
[warn] Compile / run / javaOptions will be ignored, Compile / run / fork is set to false
[info] running mdoc.Main --no-link-hygiene
info: Compiling 56 files to /home/benkio/workspace/cats/cats-docs/target/scala-2.12/resource_managed/main/jekyll
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/either.md:184:20: The outer reference in this type test cannot be checked at run time.
final case class NotANumber(string: String) extends Error
^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/freemonad.md:517:18: The outer reference in this type test cannot be checked at run time.
final case class WriteLine(line : String) extends Teletype[Unit]
^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/freemonad.md:518:18: The outer reference in this type test cannot be checked at run time.
final case class ReadLine(prompt : String) extends Teletype[String]
^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/kleisli.md:68:18: The outer reference in this type test cannot be checked at run time.
final case class Kleisli[F[_], A, B](run: A => F[B]) {
^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/state.md:17:18: The outer reference in this type test cannot be checked at run time.
final case class Robot(
^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/state.md:137:18: The outer reference in this type test cannot be checked at run time.
final case class Robot(
^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/state.md:143:18: The outer reference in this type test cannot be checked at run time.
final case class Seed(long: Long) {
^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/validated.md:46:18: The outer reference in this type test cannot be checked at run time.
final case class RegistrationData(username: String, password: String, firstName: String, lastName: String, age: Int)
^^^^^^^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/validated.md:384:18: The outer reference in this type test cannot be checked at run time.
final case class MissingConfig(field: String) extends ConfigError
^^^^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/datatypes/validated.md:385:18: The outer reference in this type test cannot be checked at run time.
final case class ParseError(field: String) extends ConfigError
^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/monoid.md:85:18: The outer reference in this type test cannot be checked at run time.
final case class NonEmptyList[A](head: A, tail: List[A]) {
^^^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:99:1: imported `Traverse' is permanently hidden by definition of trait Traverse in class App0
import cats.{Applicative, Traverse}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:32:22: The outer reference in this type test cannot be checked at run time.
case Tree.Empty() => Applicative[F].pure(Tree.Empty())
^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:33:23: The outer reference in this type test cannot be checked at run time.
case Tree.Branch(v, l, r) => Applicative[F].map3(f(v), l.traverse(f), r.traverse(f))(Tree.Branch(_, _, _))
^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:38:22: The outer reference in this type test cannot be checked at run time.
final case class Empty[A]() extends Tree[A]
^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:39:22: The outer reference in this type test cannot be checked at run time.
final case class Branch[A](value: A, left: Tree[A], right: Tree[A]) extends Tree[A]
^^^^^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/traverse.md:113:18: The outer reference in this type test cannot be checked at run time.
final case class Id[A](value: A)
^^
warning: /home/benkio/workspace/cats/docs/src/main/mdoc/typeclasses/typeclasses.md:65:18: The outer reference in this type test cannot be checked at run time.
final case class Pair[A, B](first: A, second: B)
^^^^
info: Compiled in 55s (0 errors, 18 warnings)
Copying from /home/benkio/workspace/cats/CONTRIBUTING.md to /home/benkio/workspace/cats/cats-docs/target/scala-2.12/resource_managed/main/jekyll/ExtraMdFileConfig(contributing.md,home,Map(title -> Contributing, section -> contributing, position -> 50))
Copying from /home/benkio/workspace/cats/README.md to /home/benkio/workspace/cats/cats-docs/target/scala-2.12/resource_managed/main/jekyll/ExtraMdFileConfig(index.md,home,Map(title -> Home, section -> home, position -> 0))
[info] Main Scala API documentation to /home/benkio/workspace/cats/cats-docs/target/scala-2.12/unidoc...
[info] Configuration file: /home/benkio/workspace/cats/cats-docs/target/scala-2.12/resource_managed/main/jekyll/_config.yml
[info] Source: /home/benkio/workspace/cats/cats-docs/target/scala-2.12/resource_managed/main/jekyll
[info] Destination: /home/benkio/workspace/cats/cats-docs/target/jekyll
[info] Incremental build: disabled. Enable with --incremental
[info] Generating...
[info] done in 1.755 seconds.
[info] Auto-regeneration: disabled. Use --watch to enable.
model contains 984 documentable templates
Graphviz dot encountered an error when generating the diagram for:
cats
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Graphviz dot encountered an error when generating the diagram for:
cats.free.Yoneda
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Graphviz dot encountered an error when generating the diagram for:
cats.free.FreeT
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Graphviz dot encountered an error when generating the diagram for:
cats.free.FreeInvariantMonoidal
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Graphviz dot encountered an error when generating the diagram for:
cats.free.FreeApplicative
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Graphviz dot encountered an error when generating the diagram for:
cats.free.Free
These are usually spurious errors, but if you notice a persistent error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
**********************************************************************
Diagrams will be disabled for this run because the graphviz dot tool
has malfunctioned too many times. These scaladoc flags may help:
-diagrams-debug Show debugging information for the diagram creation process.
-diagrams-dot-path <path> The path to the dot executable used to generate the inheritance diagrams. Eg: /usr/bin/dot
-diagrams-dot-restart <n> The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)
-diagrams-dot-timeout <n> The timeout before the graphviz dot util is forcefully closed, in seconds (default: 10)
Please note that graphviz package version 2.26 or above is required.
**********************************************************************
[info] Main Scala API documentation successful.
[success] Total time: 175 s (02:55), completed 12-Sep-2020 12:34:51
~/workspace/cats$ cd cats-docs/target/site/
~/workspace/cats/cats-docs/target/site$ jekyll serve
Configuration file: none
Source: /home/benkio/workspace/cats/cats-docs/target/site
Destination: /home/benkio/workspace/cats/cats-docs/target/site/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.286 seconds.
Auto-regeneration: enabled for '/home/benkio/workspace/cats/cats-docs/target/site'
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.
[2020-09-12 12:38:55] ERROR `/cats/highlight/styles/atom-one-light.css' not found.
[2020-09-12 12:38:55] ERROR `/cats/css/pattern-style.css' not found.
[2020-09-12 12:38:55] ERROR `/cats/highlight/highlight.pack.js' not found.
[2020-09-12 12:38:55] ERROR `/cats/js/version-selector.js' not found.
[2020-09-12 12:38:55] ERROR `/cats/highlight/highlight.pack.js' not found.
[2020-09-12 12:38:56] ERROR `/cats/js/version-selector.js' not found.

Cheers :pray:
@benkio ah, that's a fun one.
Basically cats has a setting for the base url and that setting is respected when the microsite gets published from SBT.
But when you run it directly via jekyll, every asset is referenced at the wrong path.
So you need to force jekyll to run it at a particular path:
$ jekyll serve -b /cats
Which I checked on master and the site looks good
hi @keynmol,
you're right, with that command now it looks fine :wink:
So, either I do something wrong (very likely) or we need to update/extend the guide
Then I will produce a PR with that change to the Contributing.md and close this Issue as well
Thanks
Most helpful comment
Yes, I got the same, I am wanting to update with ApplicativeError and MonadError. There is a #2927 which will replace tut with mdoc. As soon as that is updated we probably will have a better experience with docs. ;)