From d155cb67b3c3f07c1a89903897b0c858649f4c12 Mon Sep 17 00:00:00 2001 From: Yan Su Date: Thu, 8 Mar 2018 10:56:26 +0800 Subject: [PATCH] add scalafmt --- .scalafmt.conf | 11 +++++++++++ build.sbt | 3 +++ project/plugins.sbt | 1 + 3 files changed, 15 insertions(+) create mode 100644 .scalafmt.conf diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 000000000..0cf1ba11a --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,11 @@ +project.git = true + +maxColumn = 120 +docstrings = JavaDoc + +align = true +align.openParenCallSite = false +align.openParenDefnSite = false +continuationIndent.callSite = 2 +continuationIndent.defnSite = 2 +danglingParentheses = true diff --git a/build.sbt b/build.sbt index 9531cd517..dadd19657 100644 --- a/build.sbt +++ b/build.sbt @@ -17,6 +17,8 @@ name := Name version := GitBucketVersion scalaVersion := "2.12.5" +scalafmtOnCompile := true + // dependency settings resolvers ++= Seq( Classpaths.typesafeReleases, @@ -25,6 +27,7 @@ resolvers ++= Seq( "sonatype-snapshot" at "https://oss.sonatype.org/content/repositories/snapshots/", "amateras-snapshot" at "http://amateras.sourceforge.jp/mvn-snapshot/" ) + libraryDependencies ++= Seq( "org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "4.11.0.201803080745-r", "org.eclipse.jgit" % "org.eclipse.jgit.archive" % "4.11.0.201803080745-r", diff --git a/project/plugins.sbt b/project/plugins.sbt index a2e9993c8..3240439d3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,6 @@ scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature") +addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.4.0") addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.13") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") //addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0")