Skip to content

Commit

Permalink
Configure sbt-header plugin (#298)
Browse files Browse the repository at this point in the history
* Configure sbt-header plugin

* Task to check code format
  • Loading branch information
marcospereira authored Jan 16, 2019
1 parent 294d8b2 commit f4108ea
Show file tree
Hide file tree
Showing 105 changed files with 202 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ scala:
- 2.13.0-M3

script:
- sbt ++$TRAVIS_SCALA_VERSION 'testOnly -- xonly timefactor 5' mimaReportBinaryIssues doc
- sbt ++$TRAVIS_SCALA_VERSION 'testOnly -- xonly timefactor 5' mimaReportBinaryIssues validateCode doc

cache:
directories:
Expand Down
27 changes: 25 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ lazy val commonSettings = mimaSettings ++ Seq(
</developers>),
javacOptions in (Compile, doc) ++= javacSettings,
javacOptions in Test ++= javacSettings,
javacOptions in IntegrationTest ++= javacSettings
javacOptions in IntegrationTest ++= javacSettings,
headerLicense := {
val currentYear = java.time.Year.now(java.time.Clock.systemUTC).getValue
Some(HeaderLicense.Custom(
s"Copyright (C) 2009-$currentYear Lightbend Inc. <https://www.lightbend.com>"
))
}
)

val formattingSettings = Seq(
Expand Down Expand Up @@ -347,7 +353,7 @@ lazy val shaded = Project(id = "shaded", base = file("shaded") )
.aggregate(
`shaded-asynchttpclient`,
`shaded-oauth`
).disablePlugins(sbtassembly.AssemblyPlugin)
).disablePlugins(sbtassembly.AssemblyPlugin, HeaderPlugin)
.settings(
disableDocs,
disablePublishing,
Expand Down Expand Up @@ -523,3 +529,20 @@ releaseProcess := Seq[ReleaseStep](
releaseStepCommand("sonatypeRelease"),
pushChanges
)

lazy val checkCodeFormat = taskKey[Unit]("Check that code format is following Scalariform rules")

checkCodeFormat := {
import scala.sys.process._
val exitCode = "git diff --exit-code".!
if (exitCode != 0) {
sys.error(
"""
|ERROR: Scalariform check failed, see differences above.
|To fix, format your sources using sbt scalariformFormat test:scalariformFormat before submitting a pull request.
|Additionally, please squash your commits (eg, use git commit --amend) if you're going to update this pull request.
""".stripMargin)
}
}

addCommandAlias("validateCode", ";scalariformFormat;test:scalariformFormat;headerCheck;test:headerCheck;checkCodeFormat")
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc

import akka.http.scaladsl.server.Route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;

import play.libs.ws.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;

import play.libs.ws.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc

import akka.stream.Materializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play

import akka.actor.ActorSystem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import akka.http.scaladsl.server.Route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import akka.http.scaladsl.server.Route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import akka.stream.Materializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc.cache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2016 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc

import akka.http.scaladsl.server.Route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2016 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc

import akka.http.scaladsl.model.{ ContentTypes, HttpEntity }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.oauth;

import play.shaded.oauth.oauth.signpost.OAuthConsumer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;

import play.libs.ws.InMemoryBodyWritable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.libs.ws.ahc;

import akka.stream.javadsl.Source;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.oauth

import play.shaded.oauth.oauth.signpost.basic.DefaultOAuthConsumer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*
*
* * Copyright (C) 2009-2016 Lightbend Inc. <https://www.lightbend.com>
*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import java.security.KeyStore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import java.nio.charset.StandardCharsets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import com.typesafe.sslconfig.util.{ LoggerFactory, NoDepsLogger }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import play.shaded.ahc.org.asynchttpclient.util.HttpUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import play.api.libs.ws.{ DefaultWSCookie, WSCookie }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

/** An object for parsing application/x-www-form-urlencoded data */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import scala.collection.immutable.ListMap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import java.io.UnsupportedEncodingException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import akka.stream.scaladsl.Source
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import java.net.URI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>
*/

package play.api.libs.ws.ahc

import akka.stream.scaladsl.Source
Expand Down
Loading

0 comments on commit f4108ea

Please sign in to comment.