Skip to content

Commit

Permalink
Create common SBT settings with aliases for format/validate code
Browse files Browse the repository at this point in the history
  • Loading branch information
ihostage committed Jan 25, 2023
1 parent cf01b1e commit 4de7f12
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 32 deletions.
100 changes: 68 additions & 32 deletions .github/sync.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,70 @@
# More details in https://github.com/marketplace/actions/repo-file-sync-action
group:
# Mergify settings
- files:
- .mergify.yml
repos: |
playframework/cachecontrol
playframework/interplay
playframework/omnidoc
playframework/play-doc
playframework/play-ebean
playframework/play-file-watch
playframework/play-grpc
playframework/play-java-seed.g8
playframework/play-json
playframework/play-mailer
playframework/play-samples
playframework/play-scala-seed.g8
playframework/play-slick
playframework/play-soap
playframework/play-socket.io
playframework/play-webgoat
playframework/play-ws
playframework/playframework
playframework/playframework.com
playframework/scalatestplus-play
playframework/twirl
# playframework/anorm
# playframework/netty-reactive-streams
# playframework/play-java-react-seed
# playframework/play-scala-react-seed
# playframework/play-java-angular-seed
# playframework/play-scala-angular-seed

playframework/cachecontrol:
- source: sbt/common.sbt
dest: common.sbt

#playframework/interplay:

#playframework/omnidoc:

#playframework/play-doc:

#playframework/play-ebean:

#playframework/play-file-watch:

#playframework/play-grpc:

#playframework/play-java-seed.g8:

#playframework/play-json:

#playframework/play-mailer:

#playframework/play-samples:

#playframework/play-scala-seed.g8:

#playframework/play-slick:

playframework/play-soap:
- source: sbt/common.sbt
dest: common.sbt

#playframework/play-socket.io:

#playframework/play-webgoat:

#playframework/play-ws:

playframework/playframework:
- source: sbt/common.sbt
dest: common.sbt
- source: sbt/common.sbt
dest: documentation/common.sbt

playframework/playframework@2.8.x:
- source: sbt/common.sbt
dest: common.sbt
- source: sbt/common.sbt
dest: documentation/common.sbt

#playframework/playframework.com:

#playframework/scalatestplus-play:

#playframework/twirl:

#playframework/anorm:

#playframework/netty-reactive-streams:

#playframework/play-java-react-seed:

#playframework/play-scala-react-seed:

#playframework/play-java-angular-seed:

#playframework/play-scala-angular-seed:

38 changes: 38 additions & 0 deletions sbt/common.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (C) from 2022 The Play Framework Contributors <https://github.com/playframework>, 2011-2021 Lightbend Inc. <https://www.lightbend.com>

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NOTE: !!! THIS IS A COPY !!! //
// To edit this file use the main version in https://github.com/playframework/.github/blob/main/sbt/common.sbt //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* If you need extra commands to format source code or other documents, add following line to your `build.sbt`
* {{{
* val _ = sys.props += ("sbt_formatCode" -> List("<command1>", "<command2>",...).mkString(";"))
* }}}
*/
addCommandAlias(
"formatCode",
List(
"headerCreateAll",
"scalafmtSbt",
"scalafmtAll",
"javafmtAll"
).mkString(";") + sys.props.get("sbt_formatCode").map(";" + _).getOrElse("")
)

/**
* If you need extra commands to validate source code or other documents, add following line to your `build.sbt`
* {{{
* val _ = sys.props += ("sbt_validateCode" -> List("<command1>", "<command2>",...).mkString(";"))
* }}}
*/
addCommandAlias(
"validateCode",
List(
"headerCheckAll",
"scalafmtSbtCheck",
"scalafmtCheckAll",
"javafmtCheckAll"
).mkString(";") + sys.props.get("sbt_validateCode").map(";" + _).getOrElse("")
)

0 comments on commit 4de7f12

Please sign in to comment.