diff --git a/.scalafmt.conf b/.scalafmt.conf index 54c6682b5..858d952b9 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,2 +1,11 @@ +project { + git = true +} + +includeCurlyBraceInSelectChains = false +optIn { + breakChainOnFirstMethodDot = false +} + +style = default maxColumn = 100 -project.git = true \ No newline at end of file diff --git a/build.sbt b/build.sbt index e7a723bba..8f9094a0c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,6 @@ import ScalaJSHelper._ import org.scalajs.sbtplugin.cross.CrossProject -scalafmtConfig in ThisBuild := Some(file(".scalafmt")) - lazy val akkaVersion = "2.4.11" lazy val upickleVersion = "0.4.1" lazy val scalatagsVersion = "0.6.1" @@ -147,7 +145,6 @@ lazy val sbtScaladex = project "-Dplugin.version=" + version.value), scriptedBufferLog := false, bintrayRepository := "sbt-plugins", - bintrayOrganization := None, - scalafmt := {} + bintrayOrganization := None ) .enablePlugins(BintrayPlugin) diff --git a/data/src/main/scala/ch.epfl.scala.index.data/elastic/SeedElasticSearch.scala b/data/src/main/scala/ch.epfl.scala.index.data/elastic/SeedElasticSearch.scala index b01c385b7..0084b3c0e 100644 --- a/data/src/main/scala/ch.epfl.scala.index.data/elastic/SeedElasticSearch.scala +++ b/data/src/main/scala/ch.epfl.scala.index.data/elastic/SeedElasticSearch.scala @@ -64,14 +64,17 @@ class SeedElasticSearch(paths: DataPaths)(implicit val ec: ExecutionContext) ) println("creating index") - Await.result(esClient.execute { - create - .index(indexName) - .mappings( - mapping(projectsCollection).fields(projectFields: _*), - mapping(releasesCollection).fields(releasesFields: _*) - ) - }, Duration.Inf) + Await.result( + esClient.execute { + create + .index(indexName) + .mappings( + mapping(projectsCollection).fields(projectFields: _*), + mapping(releasesCollection).fields(releasesFields: _*) + ) + }, + Duration.Inf + ) println("loading update data") val projectConverter = new ProjectConvert(paths) diff --git a/model/src/main/scala/ch.epfl.scala.index.model/License.scala b/model/src/main/scala/ch.epfl.scala.index.model/License.scala index 2eea88d73..70e4fe756 100644 --- a/model/src/main/scala/ch.epfl.scala.index.model/License.scala +++ b/model/src/main/scala/ch.epfl.scala.index.model/License.scala @@ -68,7 +68,8 @@ object License { val TypesafeSubscriptionAgreement = License( "Typesafe Subscription Agreement", "Typesafe Subscription Agreement", - Some("http://downloads.typesafe.com/website/legal/TypesafeSubscriptionAgreement.pdf")) + Some("http://downloads.typesafe.com/website/legal/TypesafeSubscriptionAgreement.pdf") + ) val Unlicense = spdx("Unlicense", "The Unlicense") val W3C = spdx("W3C", "W3C Software Notice and License") val WTFPL = spdx("WTFPL", "Do What The F*ck You Want To Public License") diff --git a/model/src/test/scala/ch.epfl.scala.index.model/release/DefaultReleaseTests.scala b/model/src/test/scala/ch.epfl.scala.index.model/release/DefaultReleaseTests.scala index fd3bbe8d1..b800e2ab7 100644 --- a/model/src/test/scala/ch.epfl.scala.index.model/release/DefaultReleaseTests.scala +++ b/model/src/test/scala/ch.epfl.scala.index.model/release/DefaultReleaseTests.scala @@ -50,35 +50,37 @@ object DefaultReleaseTests extends org.specs2.mutable.Specification { val organization = "typelevel" val repository = "cats" val groupdId = "org.typelevel" - val releases = prepare(organization, - repository, - groupdId, - List( - ("cats-core_2.11", "0.6.0"), - ("cats-core_2.11", "0.6.0-M2"), - ("cats-core_2.11", "0.6.0-M1"), - ("cats-core_2.11", "0.5.0"), - ("cats-core_2.11", "0.4.1"), - ("cats-core_2.11", "0.4.0"), - ("cats-core_2.10", "0.6.0"), - ("cats-core_2.10", "0.6.0-M2"), - ("cats-core_2.10", "0.6.0-M1"), - ("cats-core_2.10", "0.5.0"), - ("cats-core_2.10", "0.4.1"), - ("cats-core_2.10", "0.4.0"), - ("cats-core_sjs0.6_2.11", "0.6.0"), - ("cats-core_sjs0.6_2.11", "0.6.0-M2"), - ("cats-core_sjs0.6_2.11", "0.6.0-M1"), - ("cats-core_sjs0.6_2.11", "0.5.0"), - ("cats-core_sjs0.6_2.11", "0.4.1"), - ("cats-core_sjs0.6_2.11", "0.4.0"), - ("cats-core_sjs0.6_2.10", "0.6.0"), - ("cats-core_sjs0.6_2.10", "0.6.0-M2"), - ("cats-core_sjs0.6_2.10", "0.6.0-M1"), - ("cats-core_sjs0.6_2.10", "0.5.0"), - ("cats-core_sjs0.6_2.10", "0.4.1"), - ("cats-core_sjs0.6_2.10", "0.4.0") - )) + val releases = prepare( + organization, + repository, + groupdId, + List( + ("cats-core_2.11", "0.6.0"), + ("cats-core_2.11", "0.6.0-M2"), + ("cats-core_2.11", "0.6.0-M1"), + ("cats-core_2.11", "0.5.0"), + ("cats-core_2.11", "0.4.1"), + ("cats-core_2.11", "0.4.0"), + ("cats-core_2.10", "0.6.0"), + ("cats-core_2.10", "0.6.0-M2"), + ("cats-core_2.10", "0.6.0-M1"), + ("cats-core_2.10", "0.5.0"), + ("cats-core_2.10", "0.4.1"), + ("cats-core_2.10", "0.4.0"), + ("cats-core_sjs0.6_2.11", "0.6.0"), + ("cats-core_sjs0.6_2.11", "0.6.0-M2"), + ("cats-core_sjs0.6_2.11", "0.6.0-M1"), + ("cats-core_sjs0.6_2.11", "0.5.0"), + ("cats-core_sjs0.6_2.11", "0.4.1"), + ("cats-core_sjs0.6_2.11", "0.4.0"), + ("cats-core_sjs0.6_2.10", "0.6.0"), + ("cats-core_sjs0.6_2.10", "0.6.0-M2"), + ("cats-core_sjs0.6_2.10", "0.6.0-M1"), + ("cats-core_sjs0.6_2.10", "0.5.0"), + ("cats-core_sjs0.6_2.10", "0.4.1"), + ("cats-core_sjs0.6_2.10", "0.4.0") + ) + ) val result = DefaultRelease(repository, ReleaseSelection(None, None, None), releases, None, true) diff --git a/project/plugins.sbt b/project/plugins.sbt index 911825aa4..80abc0170 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,7 +5,7 @@ addSbtPlugin("org.madoushi.sbt" % "sbt-sass" % "0.9.3") addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.1") addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.10") -addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.2.11") -addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M14") +addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.5.4") +addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15-1") libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value diff --git a/server/src/main/scala/ch.epfl.scala.index.server/routes/Oauth2.scala b/server/src/main/scala/ch.epfl.scala.index.server/routes/Oauth2.scala index abb131834..da8ecb70f 100644 --- a/server/src/main/scala/ch.epfl.scala.index.server/routes/Oauth2.scala +++ b/server/src/main/scala/ch.epfl.scala.index.server/routes/Oauth2.scala @@ -21,13 +21,15 @@ class OAuth2(github: Github, session: GithubUserSession) { get { path("login") { headerValueByType[Referer]() { referer => - redirect(Uri("https://github.com/login/oauth/authorize").withQuery( - Query( - "client_id" -> github.clientId, - "scope" -> "read:org", - "state" -> referer.value - )), - TemporaryRedirect) + redirect( + Uri("https://github.com/login/oauth/authorize").withQuery( + Query( + "client_id" -> github.clientId, + "scope" -> "read:org", + "state" -> referer.value + )), + TemporaryRedirect + ) } } ~ path("logout") {