Skip to content

Commit 563f863

Browse files
authored
Introduce sbt-tpolecat (#368)
1 parent 2728553 commit 563f863

5 files changed

Lines changed: 45 additions & 47 deletions

File tree

github4s/src/main/scala/github4s/interpreters/AuthInterpreter.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ import github4s.http.HttpClient
2828
import java.util.UUID
2929

3030
class AuthInterpreter[F[_]: Applicative](
31-
implicit client: HttpClient[F],
32-
accessToken: Option[String]
31+
implicit client: HttpClient[F]
3332
) extends Auth[F] {
3433

3534
override def newAuth(

github4s/src/main/scala/github4s/interpreters/ProjectsInterpreter.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package github4s.interpreters
1818

19-
import cats.Applicative
2019
import github4s.GithubResponses.GHResponse
2120
import github4s.algebras.Projects
2221
import github4s.domain.{Column, Pagination, Project}

github4s/src/test/scala/github4s/integration/GHTeamsSpec.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package github4s.integration
1818

1919
import cats.effect.IO
20-
import github4s.GithubIOSyntax._
2120
import github4s.Github
2221
import github4s.domain._
2322
import github4s.utils.{BaseIntegrationSpec, Integration}

github4s/src/test/scala/github4s/utils/BaseSpec.scala

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,101 +35,101 @@ trait BaseSpec extends AnyFlatSpec with Matchers with TestData with MockFactory
3535

3636
class HttpClientTest extends HttpClient[IO](Duration(1000, TimeUnit.MILLISECONDS))
3737

38-
def httpClientMockGet[Res](
38+
def httpClientMockGet[Out](
3939
url: String,
4040
params: Map[String, String] = Map.empty,
4141
headers: Map[String, String] = Map.empty,
42-
response: IO[GHResponse[Res]]
42+
response: IO[GHResponse[Out]]
4343
): HttpClient[IO] = {
4444
val httpClientMock = mock[HttpClientTest]
4545
(httpClientMock
46-
.get[Res](
46+
.get[Out](
4747
_: Option[String],
4848
_: String,
4949
_: Map[String, String],
5050
_: Map[String, String],
5151
_: Option[Pagination]
52-
)(_: Decoder[Res]))
52+
)(_: Decoder[Out]))
5353
.expects(sampleToken, url, headers ++ headerUserAgent, params, *, *)
5454
.returns(response)
5555
httpClientMock
5656
}
5757

58-
def httpClientMockPost[Req, Res](
58+
def httpClientMockPost[In, Out](
5959
url: String,
60-
req: Req,
61-
response: IO[GHResponse[Res]]
60+
req: In,
61+
response: IO[GHResponse[Out]]
6262
): HttpClient[IO] = {
6363
val httpClientMock = mock[HttpClientTest]
6464
(httpClientMock
65-
.post[Req, Res](_: Option[String], _: String, _: Map[String, String], _: Req)(
66-
_: Encoder[Req],
67-
_: Decoder[Res]
65+
.post[In, Out](_: Option[String], _: String, _: Map[String, String], _: In)(
66+
_: Encoder[In],
67+
_: Decoder[Out]
6868
))
6969
.expects(sampleToken, url, headerUserAgent, req, *, *)
7070
.returns(response)
7171
httpClientMock
7272
}
7373

74-
def httpClientMockPostAuth[Req, Res](
74+
def httpClientMockPostAuth[In, Out](
7575
url: String,
7676
headers: Map[String, String],
77-
req: Req,
78-
response: IO[GHResponse[Res]]
77+
req: In,
78+
response: IO[GHResponse[Out]]
7979
): HttpClient[IO] = {
8080
val httpClientMock = mock[HttpClientTest]
8181
(httpClientMock
82-
.postAuth[Req, Res](_: String, _: Map[String, String], _: Req)(
83-
_: Encoder[Req],
84-
_: Decoder[Res]
82+
.postAuth[In, Out](_: String, _: Map[String, String], _: In)(
83+
_: Encoder[In],
84+
_: Decoder[Out]
8585
))
8686
.expects(url, headers ++ headerUserAgent, req, *, *)
8787
.returns(response)
8888
httpClientMock
8989
}
9090

91-
def httpClientMockPostOAuth[Req, Res](
91+
def httpClientMockPostOAuth[In, Out](
9292
url: String,
93-
req: Req,
94-
response: IO[GHResponse[Res]]
93+
req: In,
94+
response: IO[GHResponse[Out]]
9595
): HttpClient[IO] = {
9696
val httpClientMock = mock[HttpClientTest]
9797
(httpClientMock
98-
.postOAuth[Req, Res](_: String, _: Map[String, String], _: Req)(
99-
_: Encoder[Req],
100-
_: Decoder[Res]
98+
.postOAuth[In, Out](_: String, _: Map[String, String], _: In)(
99+
_: Encoder[In],
100+
_: Decoder[Out]
101101
))
102102
.expects(url, headerUserAgent, req, *, *)
103103
.returns(response)
104104
httpClientMock
105105
}
106106

107-
def httpClientMockPatch[Req, Res](
107+
def httpClientMockPatch[In, Out](
108108
url: String,
109-
req: Req,
110-
response: IO[GHResponse[Res]]
109+
req: In,
110+
response: IO[GHResponse[Out]]
111111
): HttpClient[IO] = {
112112
val httpClientMock = mock[HttpClientTest]
113113
(httpClientMock
114-
.patch[Req, Res](_: Option[String], _: String, _: Map[String, String], _: Req)(
115-
_: Encoder[Req],
116-
_: Decoder[Res]
114+
.patch[In, Out](_: Option[String], _: String, _: Map[String, String], _: In)(
115+
_: Encoder[In],
116+
_: Decoder[Out]
117117
))
118118
.expects(sampleToken, url, headerUserAgent, req, *, *)
119119
.returns(response)
120120
httpClientMock
121121
}
122122

123-
def httpClientMockPut[Req, Res](
123+
def httpClientMockPut[In, Out](
124124
url: String,
125-
req: Req,
126-
response: IO[GHResponse[Res]]
125+
req: In,
126+
response: IO[GHResponse[Out]]
127127
): HttpClient[IO] = {
128128
val httpClientMock = mock[HttpClientTest]
129129
(httpClientMock
130-
.put[Req, Res](_: Option[String], _: String, _: Map[String, String], _: Req)(
131-
_: Encoder[Req],
132-
_: Decoder[Res]
130+
.put[In, Out](_: Option[String], _: String, _: Map[String, String], _: In)(
131+
_: Encoder[In],
132+
_: Decoder[Out]
133133
))
134134
.expects(sampleToken, url, headerUserAgent, req, *, *)
135135
.returns(response)
@@ -145,14 +145,14 @@ trait BaseSpec extends AnyFlatSpec with Matchers with TestData with MockFactory
145145
httpClientMock
146146
}
147147

148-
def httpClientMockDeleteWithResponse[Res](
148+
def httpClientMockDeleteWithResponse[Out](
149149
url: String,
150-
response: IO[GHResponse[Res]]
150+
response: IO[GHResponse[Out]]
151151
): HttpClient[IO] = {
152152
val httpClientMock = mock[HttpClientTest]
153153
(httpClientMock
154-
.deleteWithResponse[Res](_: Option[String], _: String, _: Map[String, String])(
155-
_: Decoder[Res]
154+
.deleteWithResponse[Out](_: Option[String], _: String, _: Map[String, String])(
155+
_: Decoder[Out]
156156
))
157157
.expects(sampleToken, url, headerUserAgent, *)
158158
.returns(response)

project/plugins.sbt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.13.1")
2-
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.3")
3-
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
4-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
5-
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.1")
1+
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.13.1")
2+
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.3")
3+
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
4+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
5+
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.1")
6+
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11")

0 commit comments

Comments
 (0)