Skip to content

Commit 819040a

Browse files
authored
Update sbt-org-policies to 0.13.1 (#352)
* Update sbt-org-policies to 0.13.1 * Update scalafmt to 2.4.2
1 parent d4dd39f commit 819040a

51 files changed

Lines changed: 537 additions & 375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ docs/src/jekyll/*.md
1010
docs/src/main/tut/changelog.md
1111

1212
# PGP keys
13-
secring.gpg
13+
secret_key.asc
1414

1515
.metals/
1616
project/.bloop/

.scalafmt.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version=2.4.2
12
style = defaultWithAlign
23
maxColumn = 100
34

@@ -20,4 +21,4 @@ rewrite {
2021
rules = [SortImports, RedundantBraces]
2122
redundantBraces.maxLines = 1
2223
}
23-
24+

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ scala:
99

1010
before_install:
1111
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
12-
openssl aes-256-cbc -K $encrypted_88322e86f6b6_key -iv $encrypted_88322e86f6b6_iv -in secring.gpg.enc -out secring.gpg -d;
12+
openssl aes-256-cbc -K $encrypted_88322e86f6b6_key -iv $encrypted_88322e86f6b6_iv -in secret_key.asc.enc -out secret_key.asc -d;
13+
gpg --import --batch --passphrase "$PGP_PASSPHRASE" secret_key.asc;
1314
fi
1415
- export PATH=${PATH}:./vendor/bundle
1516

build.sbt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
2-
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
3-
pgpSecretRing := file(s"$gpgFolder/secring.gpg")
42

53
lazy val root = (project in file("."))
64
.settings(moduleName := "github4s-root")
@@ -16,12 +14,12 @@ lazy val github4s =
1614
buildInfoKeys := Seq[BuildInfoKey](
1715
name,
1816
version,
19-
"token" -> sys.env.getOrElse("GITHUB4S_ACCESS_TOKEN", "")),
17+
"token" -> sys.env.getOrElse("GITHUB4S_ACCESS_TOKEN", "")
18+
),
2019
buildInfoPackage := "github4s"
2120
)
2221
.settings(coreDeps: _*)
2322

24-
2523
/////////////////////
2624
//// ALL MODULES ////
2725
/////////////////////

github4s/src/main/scala/github4s/Decoders.scala

Lines changed: 96 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ object Decoders {
3838
date <- c.downField("commit").downField("author").downField("date").as[String]
3939
url <- c.downField("html_url").as[String]
4040
author <- c.downField("author").as[Option[Author]]
41-
} yield
42-
Commit(
43-
sha = sha,
44-
message = message,
45-
date = date,
46-
url = url,
47-
login = author.flatMap(_.login),
48-
avatar_url = author.flatMap(_.avatar_url),
49-
author_url = author.flatMap(_.html_url)
50-
)
41+
} yield Commit(
42+
sha = sha,
43+
message = message,
44+
date = date,
45+
url = url,
46+
login = author.flatMap(_.login),
47+
avatar_url = author.flatMap(_.avatar_url),
48+
author_url = author.flatMap(_.html_url)
49+
)
5150
}
5251

5352
implicit val decodeBranch: Decoder[Branch] = Decoder.instance { c =>
@@ -56,30 +55,26 @@ object Decoders {
5655
commit <- c.downField("commit").as[BranchCommit]
5756
branchProtected <- c.downField("protected").as[Option[Boolean]]
5857
protection_url <- c.downField("protection_url").as[Option[String]]
59-
} yield
60-
Branch(
61-
name = name,
62-
commit = commit,
63-
`protected` = branchProtected,
64-
protection_url = protection_url
65-
)
58+
} yield Branch(
59+
name = name,
60+
commit = commit,
61+
`protected` = branchProtected,
62+
protection_url = protection_url
63+
)
6664
}
6765

6866
implicit val decodeBranchCommit: Decoder[BranchCommit] = Decoder.instance { c =>
6967
for {
7068
url <- c.downField("url").as[String]
7169
sha <- c.downField("sha").as[String]
72-
} yield
73-
BranchCommit(
74-
url = url,
75-
sha = sha
76-
)
70+
} yield BranchCommit(
71+
url = url,
72+
sha = sha
73+
)
7774
}
7875

7976
def readRepoUrls(c: HCursor): Either[DecodingFailure, List[Option[String]]] =
80-
RepoUrlKeys.allFields.traverse { name =>
81-
c.downField(name).as[Option[String]]
82-
}
77+
RepoUrlKeys.allFields.traverse(name => c.downField(name).as[Option[String]])
8378

8479
implicit val decodeStatusRepository: Decoder[StatusRepository] = {
8580
Decoder.instance { c =>
@@ -92,19 +87,18 @@ object Decoders {
9287
description <- c.downField("description").as[Option[String]]
9388
fork <- c.downField("fork").as[Boolean]
9489
repoUrls <- readRepoUrls(c)
95-
} yield
96-
StatusRepository(
97-
id = id,
98-
name = name,
99-
full_name = full_name,
100-
owner = owner,
101-
`private` = priv,
102-
description = description,
103-
fork = fork,
104-
urls = (RepoUrlKeys.allFields zip repoUrls.flatten map {
105-
case (urlName, value) => urlName -> value
106-
}).toMap
107-
)
90+
} yield StatusRepository(
91+
id = id,
92+
name = name,
93+
full_name = full_name,
94+
owner = owner,
95+
`private` = priv,
96+
description = description,
97+
fork = fork,
98+
urls = (RepoUrlKeys.allFields zip repoUrls.flatten map {
99+
case (urlName, value) => urlName -> value
100+
}).toMap
101+
)
108102
}
109103
}
110104

@@ -145,46 +139,45 @@ object Decoders {
145139
clone_url <- c.downField("clone_url").as[String]
146140
svn_url <- c.downField("svn_url").as[String]
147141
repoUrls <- readRepoUrls(c)
148-
} yield
149-
Repository(
150-
id = id,
151-
name = name,
152-
full_name = full_name,
153-
owner = owner,
154-
`private` = priv,
155-
description = description,
156-
fork = fork,
157-
created_at = created_at,
158-
updated_at = updated_at,
159-
pushed_at = pushed_at,
160-
homepage = homepage,
161-
language = language,
162-
organization = organization,
163-
status = RepoStatus(
164-
size = size,
165-
stargazers_count = stargazers_count,
166-
watchers_count = watchers_count,
167-
forks_count = forks_count,
168-
open_issues_count = open_issues_count,
169-
open_issues = open_issues,
170-
watchers = watchers,
171-
network_count = network_count,
172-
subscribers_count = subscribers_count,
173-
has_issues = has_issues,
174-
has_downloads = has_downloads,
175-
has_wiki = has_wiki,
176-
has_pages = has_pages
177-
),
178-
urls = RepoUrls(
179-
url = url,
180-
html_url = html_url,
181-
git_url = git_url,
182-
ssh_url = ssh_url,
183-
clone_url = clone_url,
184-
svn_url = svn_url,
185-
otherUrls = (RepoUrlKeys.allFields zip repoUrls.flatten).toMap
186-
)
142+
} yield Repository(
143+
id = id,
144+
name = name,
145+
full_name = full_name,
146+
owner = owner,
147+
`private` = priv,
148+
description = description,
149+
fork = fork,
150+
created_at = created_at,
151+
updated_at = updated_at,
152+
pushed_at = pushed_at,
153+
homepage = homepage,
154+
language = language,
155+
organization = organization,
156+
status = RepoStatus(
157+
size = size,
158+
stargazers_count = stargazers_count,
159+
watchers_count = watchers_count,
160+
forks_count = forks_count,
161+
open_issues_count = open_issues_count,
162+
open_issues = open_issues,
163+
watchers = watchers,
164+
network_count = network_count,
165+
subscribers_count = subscribers_count,
166+
has_issues = has_issues,
167+
has_downloads = has_downloads,
168+
has_wiki = has_wiki,
169+
has_pages = has_pages
170+
),
171+
urls = RepoUrls(
172+
url = url,
173+
html_url = html_url,
174+
git_url = git_url,
175+
ssh_url = ssh_url,
176+
clone_url = clone_url,
177+
svn_url = svn_url,
178+
otherUrls = (RepoUrlKeys.allFields zip repoUrls.flatten).toMap
187179
)
180+
)
188181
}
189182
}
190183

@@ -200,10 +193,9 @@ object Decoders {
200193
implicit val decodeGistFile: Decoder[GistFile] = Decoder.instance { c =>
201194
for {
202195
content <- c.downField("content").as[String]
203-
} yield
204-
GistFile(
205-
content = content
206-
)
196+
} yield GistFile(
197+
content = content
198+
)
207199
}
208200

209201
implicit val decodeGist: Decoder[Gist] = Decoder.instance { c =>
@@ -213,24 +205,26 @@ object Decoders {
213205
description <- c.downField("description").as[String]
214206
public <- c.downField("public").as[Boolean]
215207
files <- c.downField("files").as[Map[String, GistFile]]
216-
} yield
217-
Gist(
218-
url = url,
219-
id = id,
220-
description = description,
221-
public = public,
222-
files = files
223-
)
208+
} yield Gist(
209+
url = url,
210+
id = id,
211+
description = description,
212+
public = public,
213+
files = files
214+
)
224215
}
225216

226217
implicit val decodeStarredRepository: Decoder[StarredRepository] =
227218
Decoder[Repository]
228219
.map(StarredRepository(None, _))
229-
.or(Decoder.instance(c =>
230-
for {
231-
starred_at <- c.downField("starred_at").as[String]
232-
repo <- c.downField("repo").as[Repository]
233-
} yield StarredRepository(Some(starred_at), repo)))
220+
.or(
221+
Decoder.instance(c =>
222+
for {
223+
starred_at <- c.downField("starred_at").as[String]
224+
repo <- c.downField("repo").as[Repository]
225+
} yield StarredRepository(Some(starred_at), repo)
226+
)
227+
)
234228

235229
implicit def decodeNonEmptyList[T](implicit D: Decoder[T]): Decoder[NonEmptyList[T]] = {
236230

@@ -273,12 +267,14 @@ object Decoders {
273267
implicit val decodeStargazer: Decoder[Stargazer] =
274268
decoderUser
275269
.map(Stargazer(None, _))
276-
.or(Decoder.instance(c =>
277-
for {
278-
starred_at <- c.downField("starred_at").as[String]
279-
user <- c.downField("user").as[User]
280-
} yield Stargazer(Some(starred_at), user)))
270+
.or(
271+
Decoder.instance(c =>
272+
for {
273+
starred_at <- c.downField("starred_at").as[String]
274+
user <- c.downField("user").as[User]
275+
} yield Stargazer(Some(starred_at), user)
276+
)
277+
)
281278

282279
implicit val decodeTeam: Decoder[Team] = deriveDecoder[Team]
283-
284280
}

github4s/src/main/scala/github4s/Encoders.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ object Encoders {
3838
Encoder.encodeString.contramap(_.value)
3939

4040
implicit val encodeEditGistFile: Encoder[EditGistFile] = {
41-
deriveEncoder[EditGistFile].mapJsonObject(_.filter(e =>
42-
!(e._1.equals("filename") && e._2.isNull)))
41+
deriveEncoder[EditGistFile].mapJsonObject(
42+
_.filter(e => !(e._1.equals("filename") && e._2.isNull))
43+
)
4344
}
4445

4546
implicit val encoderCreateReferenceRequest: Encoder[CreateReferenceRequest] =

github4s/src/main/scala/github4s/Github.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ import scala.concurrent.ExecutionContext
2424
import scala.concurrent.duration.Duration
2525

2626
class Github[F[_]: ConcurrentEffect](accessToken: Option[String], timeout: Option[Duration])(
27-
implicit ec: ExecutionContext) {
27+
implicit ec: ExecutionContext
28+
) {
2829

2930
private lazy val module: GithubAPIs[F] =
30-
new GithubAPIv3[F](accessToken, timeout.getOrElse(Duration(1000l, MILLISECONDS)))
31+
new GithubAPIv3[F](accessToken, timeout.getOrElse(Duration(1000L, MILLISECONDS)))
3132

3233
lazy val users: Users[F] = module.users
3334
lazy val repos: Repositories[F] = module.repos
@@ -45,7 +46,8 @@ object Github {
4546

4647
def apply[F[_]: ConcurrentEffect](
4748
accessToken: Option[String] = None,
48-
timeout: Option[Duration] = None)(implicit ec: ExecutionContext): Github[F] =
49+
timeout: Option[Duration] = None
50+
)(implicit ec: ExecutionContext): Github[F] =
4951
new Github[F](accessToken, timeout)
5052

5153
}

github4s/src/main/scala/github4s/GithubIOSyntax.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ object GithubIOSyntax {
3939

4040
def toId(implicit liftIO: LiftIO[Id]): Id[A] = liftIO.liftIO(self)
4141
}
42-
}
42+
}

github4s/src/main/scala/github4s/algebras/Activities.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ trait Activities[F[_]] {
3434
id: Int,
3535
subscribed: Boolean,
3636
ignored: Boolean,
37-
headers: Map[String, String] = Map()): F[GHResponse[Subscription]]
37+
headers: Map[String, String] = Map()
38+
): F[GHResponse[Subscription]]
3839

3940
/**
4041
* List the users having starred a particular repository
@@ -51,7 +52,8 @@ trait Activities[F[_]] {
5152
repo: String,
5253
timeline: Boolean,
5354
pagination: Option[Pagination] = None,
54-
headers: Map[String, String] = Map()): F[GHResponse[List[Stargazer]]]
55+
headers: Map[String, String] = Map()
56+
): F[GHResponse[List[Stargazer]]]
5557

5658
/**
5759
* List the repositories starred by a particular user
@@ -71,6 +73,7 @@ trait Activities[F[_]] {
7173
sort: Option[String] = None,
7274
direction: Option[String] = None,
7375
pagination: Option[Pagination] = None,
74-
headers: Map[String, String] = Map()): F[GHResponse[List[StarredRepository]]]
76+
headers: Map[String, String] = Map()
77+
): F[GHResponse[List[StarredRepository]]]
7578

7679
}

github4s/src/main/scala/github4s/algebras/Auth.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ trait Auth[F[_]] {
5555
def authorizeUrl(
5656
client_id: String,
5757
redirect_uri: String,
58-
scopes: List[String],
58+
scopes: List[String]
5959
): F[GHResponse[Authorize]]
6060

6161
/**

0 commit comments

Comments
 (0)