docs.scala-lang icon indicating copy to clipboard operation
docs.scala-lang copied to clipboard

in Toolkit sbt example, use flat single-project style

Open SethTisue opened this issue 1 year ago • 2 comments

a language newcomer on Discord was bitten by this today

note that the examples weren't just unnecessarily complicated, they also used file("example") instead of file("."), so the user ended up having both a root and an example project, and they didn't understand that they needed to put their sources in example/src, because how on earth would they know that?

we can avoid issues like that by simply using the flat style

SethTisue avatar May 07 '24 15:05 SethTisue

I am not convince about that because I think we should slowly discourage people from using the sbt flat style:

  • the difference between flat, and ThisBuild, and Global and project.in(file(".")) is non-obvious for beginners
  • for single module project we should better use Scala CLI whose syntax is as flat as it can be

However I am okay to use file(".") instead of file("example"). It seems that's what we do in scala/scala3.g8 template.

adpi2 avatar May 08 '24 07:05 adpi2

okay, I'll make the change

SethTisue avatar May 08 '24 13:05 SethTisue

LGTM! Is it ready to be merged?

adpi2 avatar Aug 09 '24 07:08 adpi2