diff options
| -rw-r--r-- | .scalafmt.conf | 26 | ||||
| -rw-r--r-- | .travis.yml | 6 | ||||
| -rw-r--r-- | project/plugins.sbt | 2 |
3 files changed, 34 insertions, 0 deletions
diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 00000000..f74e5504 --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,26 @@ +version = 2.6.4 + +maxColumn = 120 +align = most +continuationIndent.defnSite = 2 +assumeStandardLibraryStripMargin = true +docstrings = ScalaDoc +lineEndings = preserve +includeCurlyBraceInSelectChains = false +danglingParentheses = true + +align.tokens.add = [ + { + code = ":" + } +] + +newlines.alwaysBeforeCurlyBraceLambdaParams = false +newlines.alwaysBeforeMultilineDef = false +newlines.implicitParamListModifierForce = [before] + +verticalMultiline.atDefnSite = true + +optIn.annotationNewlines = true + +rewrite.rules = [SortImports, PreferCurlyFors, AvoidInfix] diff --git a/.travis.yml b/.travis.yml index 9163efa4..424d60c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,12 @@ jobs: - project/project/ - project/target/ - stage: test + name: "All files must be formatted with scalafmt" + workspaces: + use: firrtl_build + script: + - sbt scalafmtCheck + - stage: test name: "Unidoc builds (no warnings)" workspaces: use: firrtl_build diff --git a/project/plugins.sbt b/project/plugins.sbt index 45d9425a..fb530385 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -22,4 +22,6 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") + libraryDependencies += "com.github.os72" % "protoc-jar" % "3.11.4" |
