diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 000000000..b2f01b993 --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,13 @@ +version=2.3.2 +project.git = true + +align.openParenCallSite = true +align.openParenDefnSite = true +maxColumn = 120 +continuationIndent.defnSite = 2 +assumeStandardLibraryStripMargin = true +danglingParentheses = true +rewrite.rules = [SortImports, SortModifiers] +docstrings = JavaDoc + +onTestFailure = "To fix this, run ./scalafmt from the project root directory" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 59663ab35..a6b66a426 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ jdk: scala: - 2.12.1 -script: +script:- - travis_wait sbt ++$TRAVIS_SCALA_VERSION update + - sbt scalafmtSbtCheck scalafmtCheck test:scalafmtCheck - travis_wait sbt ++$TRAVIS_SCALA_VERSION -Djava.awt.headless=true compile test - - sbt scalariformFormat && git diff --exit-code # fails build if scalariform results in changes to the code + diff --git a/project/plugins.sbt b/project/plugins.sbt index 73b34b86b..b17b89577 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -15,4 +15,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.2.1")