A repository template for Scala development in Codespaces
This GitHub repository template enables Scala 3 development in GitHub Codespaces.
As a starting point, the repository defines a minimal sbt project containing a "Hello, world." function and one unit test. The project is ready to be extended.
To facilitate development in Codespaces, the repository defines a dev container that references an official sbt image, making available a JDK, Scala and sbt. It also enables several VS Code extensions, including Scala Syntax for syntax highlighting and Metals for a fully-fledged IDE experience.
The repository also defines VS Code settings, which, among other things, provide that Scalafmt is the default formatter and that it is applied automatically upon saving a file.
- Create a new repository based on this repository template.
- Create a codespace for the new repository.
- When prompted by Metals with "New sbt workspace detected", click "Import build".
Optionally, refactor the following files and directories to remove references to this repository template:
.devcontainer/devcontainer.json
name
build.sbt
organization
name
src/main/scala
- Package declaration in
HelloWorld.scala
- Package subdirectories accordingly
- Package declaration in
src/test/scala
- Package declaration in
HelloWorldTest.scala
- Package subdirectories accordingly
- Package declaration in