diff --git a/common.sbt b/common.sbt index d48fe3b..94c6ebd 100644 --- a/common.sbt +++ b/common.sbt @@ -5,6 +5,12 @@ // 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("", "",...).mkString(";")) + * }}} + */ addCommandAlias( "formatCode", List( @@ -12,9 +18,15 @@ addCommandAlias( "scalafmtSbt", "scalafmtAll", "javafmtAll" - ).mkString(";") + ).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("", "",...).mkString(";")) + * }}} + */ addCommandAlias( "validateCode", List( @@ -22,5 +34,5 @@ addCommandAlias( "scalafmtSbtCheck", "scalafmtCheckAll", "javafmtCheckAll" - ).mkString(";") + ).mkString(";") + sys.props.get("sbt_validateCode").map(";" + _).getOrElse("") )