Add scalafmt plugin to scala-play-server generator
IN
6h ago+229+229+012345678901234567890123456789-83-83-01234567890123456789
Part of #23274 — adds the scalafmt setup to the scala-play-server generator, following the same pattern as the already-merged generators (scala-http4s, scala-sttp, scala-finch, etc., e.g. #23300).
What changed
ScalaPlayFrameworkServerCodegen: generate a.scalafmt.confsupporting file.- New
scala-play-server/scalafmt.mustachetemplate (scalafmt3.10.6,runner.dialect = scala212— same configuration asscala-finch, which also targets Scala 2.12). scala-play-server/project/plugins.sbt.mustache: add theorg.scalameta sbt-scalafmt 2.5.6plugin (sbt1.2.4is used by this generator, so the plugin is compatible).- Regenerated
samples/server/petstore/scala-play-server(the sample was last generated at5.0.0-SNAPSHOT, so the diff also carries unrelated pending template drift such as the@Generatedannotation and import changes).
Notes for the remaining generators from #23274
scalatrais being decommissioned (#24525), so it is intentionally skipped.scalazstill targets Scala2.11/ sbt0.13.15; modernsbt-scalafmtdoes not support sbt 0.13, so enabling scalafmt there would require a build toolchain bump first.scala-lagom-serverhas no sample config (bin/configs), so it is left for a follow-up.
PR checklist
- Read the contribution guidelines.
- Regenerated the affected sample via
./bin/generate-samples.sh bin/configs/unmaintained/scala-play-server.yaml; no files deleted. - Pull request is created against the
masterbranch.
Summary by cubic
Adds scalafmt formatting setup to the scala-play-server generator, matching what was already merged for other Scala generators. Generated projects now include a .scalafmt.conf (scalafmt 3.10.6, scala212 dialect), the sbt-scalafmt 2.5.6 plugin, and an sbt bump to 1.10.11 so the plugin loads reliably.
Part of #23274.
Sample regeneration
- The regenerated petstore sample also picks up unrelated pending template drift (
@Generatedannotations, import and spec changes) because it was last generated at5.0.0-SNAPSHOTand is now at7.27.0-SNAPSHOT.
Remaining generators
scalatrais skipped since it's being decommissioned.scalazstill targets Scala 2.11 / sbt 0.13, which modernsbt-scalafmtdoesn't support.scala-lagom-serverhas no sample config and is left for a follow-up.