Skip to content

Commit bf618a7

Browse files
committed
dart format :sigh:
1 parent 9c3cc41 commit bf618a7

16 files changed

+88
-65
lines changed

example/repos.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ List<Repository>? repos;
1111
Map<String, Comparator<Repository>> sorts = {
1212
'stars': (Repository a, Repository b) =>
1313
b.stargazersCount!.compareTo(a.stargazersCount!),
14-
'forks': (Repository a, Repository b) => b.forksCount!.compareTo(a.forksCount!),
15-
'created': (Repository a, Repository b) => b.createdAt!.compareTo(a.createdAt!),
14+
'forks': (Repository a, Repository b) =>
15+
b.forksCount!.compareTo(a.forksCount!),
16+
'created': (Repository a, Repository b) =>
17+
b.createdAt!.compareTo(a.createdAt!),
1618
'pushed': (Repository a, Repository b) => b.pushedAt!.compareTo(a.pushedAt!),
1719
'size': (Repository a, Repository b) => b.size!.compareTo(a.size!)
1820
};

lib/src/common/activity_service.dart

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ class ActivityService extends Service {
1717
///
1818
/// API docs: https://developer.github.com/v3/activity/events/#list-public-events
1919
Stream<Event> listPublicEvents({int pages = 2}) {
20-
return PaginationHelper(github)
21-
.objects('GET', '/events', (dynamic i) => Event.fromJson(i), pages: pages);
20+
return PaginationHelper(github).objects(
21+
'GET', '/events', (dynamic i) => Event.fromJson(i),
22+
pages: pages);
2223
}
2324

2425
/// Lists public events for a network of repositories.
2526
///
2627
/// API docs: https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories
2728
Stream<Event> listRepositoryNetworkEvents(RepositorySlug slug,
2829
{int pages = 2}) {
29-
return PaginationHelper(github).objects(
30-
'GET', '/networks/${slug.fullName}/events', (dynamic i) => Event.fromJson(i),
30+
return PaginationHelper(github).objects('GET',
31+
'/networks/${slug.fullName}/events', (dynamic i) => Event.fromJson(i),
3132
pages: pages);
3233
}
3334

@@ -47,8 +48,10 @@ class ActivityService extends Service {
4748
///
4849
/// API docs: https://developer.github.com/v3/activity/events/#list-repository-events
4950
Stream<Event> listRepositoryIssueEvents(RepositorySlug slug, {int? pages}) {
50-
return PaginationHelper(github).objects('GET',
51-
'/repos/${slug.fullName}/issues/events', (dynamic i) => Event.fromJson(i),
51+
return PaginationHelper(github).objects(
52+
'GET',
53+
'/repos/${slug.fullName}/issues/events',
54+
(dynamic i) => Event.fromJson(i),
5255
pages: pages);
5356
}
5457

@@ -61,8 +64,8 @@ class ActivityService extends Service {
6164
///
6265
/// API docs: https://developer.github.com/v3/activity/events/#list-repository-events
6366
Stream<Event> listRepositoryEvents(RepositorySlug slug, {int? pages}) {
64-
return PaginationHelper(github).objects(
65-
'GET', '/repos/${slug.fullName}/events', (dynamic i) => Event.fromJson(i),
67+
return PaginationHelper(github).objects('GET',
68+
'/repos/${slug.fullName}/events', (dynamic i) => Event.fromJson(i),
6669
pages: pages);
6770
}
6871

@@ -112,8 +115,8 @@ class ActivityService extends Service {
112115
///
113116
/// API docs: https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user
114117
Stream<Event> listPublicEventsPerformedByUser(String username, {int? pages}) {
115-
return PaginationHelper(github).objects(
116-
'GET', '/users/$username/events/public', (dynamic i) => Event.fromJson(i),
118+
return PaginationHelper(github).objects('GET',
119+
'/users/$username/events/public', (dynamic i) => Event.fromJson(i),
117120
pages: pages);
118121
}
119122

@@ -191,7 +194,8 @@ class ActivityService extends Service {
191194
/// API docs: https://developer.github.com/v3/activity/notifications/#view-a-single-thread
192195
Future<Notification> getThread(String threadId) =>
193196
github.getJSON('/notification/threads/$threadId',
194-
statusCode: StatusCodes.OK, convert: (dynamic i) => Notification.fromJson(i));
197+
statusCode: StatusCodes.OK,
198+
convert: (dynamic i) => Notification.fromJson(i));
195199

196200
/// Mark the specified notification thread as read.
197201
///
@@ -212,16 +216,16 @@ class ActivityService extends Service {
212216
///
213217
/// API docs: https://developer.github.com/v3/activity/starring/#list-stargazers
214218
Stream<User> listStargazers(RepositorySlug slug) {
215-
return PaginationHelper(github).objects(
216-
'GET', '/repos/${slug.fullName}/stargazers', (dynamic i) => User.fromJson(i));
219+
return PaginationHelper(github).objects('GET',
220+
'/repos/${slug.fullName}/stargazers', (dynamic i) => User.fromJson(i));
217221
}
218222

219223
/// Lists all the repos starred by a user.
220224
///
221225
/// API docs: https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
222226
Stream<Repository> listStarredByUser(String user) {
223-
return PaginationHelper(github)
224-
.objects('GET', '/users/$user/starred', (dynamic i) => Repository.fromJson(i));
227+
return PaginationHelper(github).objects(
228+
'GET', '/users/$user/starred', (dynamic i) => Repository.fromJson(i));
225229
}
226230

227231
/// Lists all the repos by the current user.
@@ -267,24 +271,24 @@ class ActivityService extends Service {
267271
///
268272
/// API docs: https://developer.github.com/v3/activity/watching/#list-watchers
269273
Stream<User> listWatchers(RepositorySlug slug) {
270-
return PaginationHelper(github).objects(
271-
'GET', '/repos/${slug.fullName}/subscribers', (dynamic i) => User.fromJson(i));
274+
return PaginationHelper(github).objects('GET',
275+
'/repos/${slug.fullName}/subscribers', (dynamic i) => User.fromJson(i));
272276
}
273277

274278
/// Lists the repositories the specified user is watching.
275279
///
276280
/// API docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched
277281
Stream<Repository> listWatchedByUser(String user) {
278-
return PaginationHelper(github).objects(
279-
'GET', '/users/$user/subscriptions', (dynamic i) => Repository.fromJson(i));
282+
return PaginationHelper(github).objects('GET', '/users/$user/subscriptions',
283+
(dynamic i) => Repository.fromJson(i));
280284
}
281285

282286
/// Lists the repositories the current user is watching.
283287
///
284288
/// API docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched
285289
Stream<Repository> listWatched() {
286-
return PaginationHelper(github)
287-
.objects('GET', '/user/subscriptions', (dynamic i) => Repository.fromJson(i));
290+
return PaginationHelper(github).objects(
291+
'GET', '/user/subscriptions', (dynamic i) => Repository.fromJson(i));
288292
}
289293

290294
/// Fetches repository subscription information.
@@ -364,7 +368,9 @@ class EventPoller {
364368
for (final item in json) {
365369
final event = Event.fromJson(item);
366370

367-
if (after == null ? false : event.createdAt!.toUtc().isBefore(after)) {
371+
if (after == null
372+
? false
373+
: event.createdAt!.toUtc().isBefore(after)) {
368374
continue;
369375
}
370376

lib/src/common/authorizations_service.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class AuthorizationsService extends Service {
1616
///
1717
/// API docs: https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations
1818
Stream<Authorization> listAuthorizations() {
19-
return PaginationHelper(github)
20-
.objects('GET', '/authorizations', (dynamic i) => Authorization.fromJson(i));
19+
return PaginationHelper(github).objects(
20+
'GET', '/authorizations', (dynamic i) => Authorization.fromJson(i));
2121
}
2222

2323
/// Fetches an authorization specified by [id].

lib/src/common/gists_service.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class GistsService extends Service {
1414
///
1515
/// API docs: https://developer.github.com/v3/gists/#list-gists
1616
Stream<Gist> listUserGists(String username) {
17-
return PaginationHelper(github)
18-
.objects('GET', '/users/$username/gists', (dynamic i) => Gist.fromJson(i));
17+
return PaginationHelper(github).objects(
18+
'GET', '/users/$username/gists', (dynamic i) => Gist.fromJson(i));
1919
}
2020

2121
/// Fetches the gists for the currently authenticated user.
@@ -166,8 +166,8 @@ class GistsService extends Service {
166166
///
167167
/// API docs: https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist
168168
Stream<GistComment> listComments(String gistId) {
169-
return PaginationHelper(github).objects(
170-
'GET', '/gists/$gistId/comments', (dynamic i) => GistComment.fromJson(i));
169+
return PaginationHelper(github).objects('GET', '/gists/$gistId/comments',
170+
(dynamic i) => GistComment.fromJson(i));
171171
}
172172

173173
// TODO: Implement getComment: https://developer.github.com/v3/gists/comments/#get-a-single-comment

lib/src/common/git_service.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class GitService extends Service {
1515
/// API docs: https://developer.github.com/v3/git/blobs/#get-a-blob
1616
Future<GitBlob> getBlob(RepositorySlug slug, String? sha) =>
1717
github.getJSON('/repos/${slug.fullName}/git/blobs/$sha',
18-
convert: (dynamic i) => GitBlob.fromJson(i), statusCode: StatusCodes.OK);
18+
convert: (dynamic i) => GitBlob.fromJson(i),
19+
statusCode: StatusCodes.OK);
1920

2021
/// Creates a blob with specified [blob] content.
2122
///
@@ -32,7 +33,8 @@ class GitService extends Service {
3233
/// API docs: https://developer.github.com/v3/git/commits/#get-a-commit
3334
Future<GitCommit> getCommit(RepositorySlug slug, String? sha) =>
3435
github.getJSON('/repos/${slug.fullName}/git/commits/$sha',
35-
convert: (dynamic i) => GitCommit.fromJson(i), statusCode: StatusCodes.OK);
36+
convert: (dynamic i) => GitCommit.fromJson(i),
37+
statusCode: StatusCodes.OK);
3638

3739
/// Creates a new commit in a repository.
3840
///
@@ -51,7 +53,8 @@ class GitService extends Service {
5153
/// API docs: https://developer.github.com/v3/git/refs/#get-a-reference
5254
Future<GitReference> getReference(RepositorySlug slug, String ref) =>
5355
github.getJSON('/repos/${slug.fullName}/git/refs/$ref',
54-
convert: (dynamic i) => GitReference.fromJson(i), statusCode: StatusCodes.OK);
56+
convert: (dynamic i) => GitReference.fromJson(i),
57+
statusCode: StatusCodes.OK);
5558

5659
/// Lists the references in a repository.
5760
///
@@ -120,7 +123,8 @@ class GitService extends Service {
120123
/// API docs: https://developer.github.com/v3/git/tags/#get-a-tag
121124
Future<GitTag> getTag(RepositorySlug slug, String? sha) =>
122125
github.getJSON('/repos/${slug.fullName}/git/tags/$sha',
123-
convert: (dynamic i) => GitTag.fromJson(i), statusCode: StatusCodes.OK);
126+
convert: (dynamic i) => GitTag.fromJson(i),
127+
statusCode: StatusCodes.OK);
124128

125129
/// Creates a new tag in a repository.
126130
///
@@ -145,7 +149,8 @@ class GitService extends Service {
145149
}
146150

147151
return github.getJSON(path,
148-
convert: (dynamic j) => GitTree.fromJson(j), statusCode: StatusCodes.OK);
152+
convert: (dynamic j) => GitTree.fromJson(j),
153+
statusCode: StatusCodes.OK);
149154
}
150155

151156
/// Creates a new tree in a repository.

lib/src/common/github.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class GitHub {
368368
} else {
369369
return response;
370370
}
371-
371+
372372
throw UnknownError(this);
373373
}
374374

lib/src/common/issues_service.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ class IssuesService extends Service {
196196
///
197197
/// API docs: https://developer.github.com/v3/issues/assignees/#list-assignees
198198
Stream<User> listAssignees(RepositorySlug slug) {
199-
return PaginationHelper(github).objects(
200-
'GET', '/repos/${slug.fullName}/assignees', (dynamic i) => User.fromJson(i));
199+
return PaginationHelper(github).objects('GET',
200+
'/repos/${slug.fullName}/assignees', (dynamic i) => User.fromJson(i));
201201
}
202202

203203
/// Checks if a user is an assignee for the specified repository.
@@ -269,15 +269,18 @@ class IssuesService extends Service {
269269
/// API docs: https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
270270
Stream<IssueLabel> listLabels(RepositorySlug slug) {
271271
return PaginationHelper(github).objects(
272-
'GET', '/repos/${slug.fullName}/labels', (dynamic i) => IssueLabel.fromJson(i));
272+
'GET',
273+
'/repos/${slug.fullName}/labels',
274+
(dynamic i) => IssueLabel.fromJson(i));
273275
}
274276

275277
/// Fetches a single label.
276278
///
277279
/// API docs: https://developer.github.com/v3/issues/labels/#get-a-single-label
278280
Future<IssueLabel> getLabel(RepositorySlug slug, String name) =>
279281
github.getJSON('/repos/${slug.fullName}/labels/$name',
280-
convert: (dynamic i) => IssueLabel.fromJson(i), statusCode: StatusCodes.OK);
282+
convert: (dynamic i) => IssueLabel.fromJson(i),
283+
statusCode: StatusCodes.OK);
281284

282285
/// Creates a new label on the specified repository.
283286
///
@@ -373,8 +376,10 @@ class IssuesService extends Service {
373376
///
374377
/// API docs: https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository
375378
Stream<Milestone> listMilestones(RepositorySlug slug) {
376-
return PaginationHelper(github).objects('GET',
377-
'/repos/${slug.fullName}/milestones', (dynamic i) => Milestone.fromJson(i));
379+
return PaginationHelper(github).objects(
380+
'GET',
381+
'/repos/${slug.fullName}/milestones',
382+
(dynamic i) => Milestone.fromJson(i));
378383
}
379384

380385
// TODO: Implement getMilestone: https://developer.github.com/v3/issues/milestones/#get-a-single-milestone

lib/src/common/misc_service.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class MiscService extends Service {
6969
/// Gets the GitHub API Status.
7070
Future<APIStatus> getApiStatus() =>
7171
github.getJSON('https://status.github.com/api/status.json',
72-
statusCode: StatusCodes.OK, convert: (dynamic i) => APIStatus.fromJson(i));
72+
statusCode: StatusCodes.OK,
73+
convert: (dynamic i) => APIStatus.fromJson(i));
7374

7475
/// Returns an ASCII Octocat with the specified [text].
7576
Future<String> getOctocat([String? text]) {

lib/src/common/model/checks.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class CheckRunAction {
312312
required this.label,
313313
required this.description,
314314
required this.identifier,
315-
}) : assert(label.length <= 20),
315+
}) : assert(label.length <= 20),
316316
assert(description.length <= 40),
317317
assert(identifier.length <= 20);
318318

lib/src/common/model/repos.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ class Tag {
192192

193193
Tag(this.name, this.commit, this.zipUrl, this.tarUrl);
194194

195-
factory Tag.fromJson(Map<String, dynamic> input) =>
196-
_$TagFromJson(input);
195+
factory Tag.fromJson(Map<String, dynamic> input) => _$TagFromJson(input);
197196

198197
@override
199198
String toString() => 'Tag: $name';

lib/src/common/orgs_service.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class OrganizationsService extends Service {
7575
///
7676
/// API docs: https://developer.github.com/v3/orgs/teams/#list-teams
7777
Stream<Team> listTeams(String orgName) {
78-
return PaginationHelper(github)
79-
.objects('GET', '/orgs/$orgName/teams', (dynamic i) => Team.fromJson(i));
78+
return PaginationHelper(github).objects(
79+
'GET', '/orgs/$orgName/teams', (dynamic i) => Team.fromJson(i));
8080
}
8181

8282
/// Gets the team specified by the [teamId].
@@ -193,8 +193,8 @@ class OrganizationsService extends Service {
193193
///
194194
/// API docs: https://developer.github.com/v3/orgs/teams/#list-team-repos
195195
Stream<Repository> listTeamRepositories(int teamId) {
196-
return PaginationHelper(github)
197-
.objects('GET', '/teams/$teamId/repos', (dynamic i) => Repository.fromJson(i));
196+
return PaginationHelper(github).objects(
197+
'GET', '/teams/$teamId/repos', (dynamic i) => Repository.fromJson(i));
198198
}
199199

200200
/// Checks if a team manages the specified repository.
@@ -242,8 +242,8 @@ class OrganizationsService extends Service {
242242
///
243243
/// API docs: https://developer.github.com/v3/orgs/hooks/#list-hooks
244244
Stream<Hook> listHooks(String org) {
245-
return PaginationHelper(github).objects(
246-
'GET', '/orgs/$org/hooks', (dynamic i) => Hook.fromJson(i)..repoName = org);
245+
return PaginationHelper(github).objects('GET', '/orgs/$org/hooks',
246+
(dynamic i) => Hook.fromJson(i)..repoName = org);
247247
}
248248

249249
/// Fetches a single hook by [id].

lib/src/common/pulls_service.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class PullRequestsService extends Service {
4343
/// API docs: https://developer.github.com/v3/pulls/#get-a-single-pull-request
4444
Future<PullRequest> get(RepositorySlug slug, int number) =>
4545
github.getJSON('/repos/${slug.fullName}/pulls/$number',
46-
convert: (dynamic i) => PullRequest.fromJson(i), statusCode: StatusCodes.OK);
46+
convert: (dynamic i) => PullRequest.fromJson(i),
47+
statusCode: StatusCodes.OK);
4748

4849
/// Creates a Pull Request based on the given [request].
4950
///

lib/src/common/repos_service.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,7 @@ class RepositoriesService extends Service {
832832
/// * [id]: id of the key to retrieve.
833833
///
834834
/// https://developer.github.com/v3/repos/keys/#get
835-
Future<PublicKey> getDeployKey(RepositorySlug slug,
836-
{required int id}) async {
835+
Future<PublicKey> getDeployKey(RepositorySlug slug, {required int id}) async {
837836
ArgumentError.checkNotNull(slug);
838837
ArgumentError.checkNotNull(id);
839838
return github.getJSON<Map<String, dynamic>, PublicKey>(

lib/src/common/users_service.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class UsersService extends Service {
7979
/// Lists all users.
8080
///
8181
/// API docs: https://developer.github.com/v3/users/#get-all-users
82-
Stream<User> listUsers({int? pages, int? since}) =>
83-
PaginationHelper(github).objects('GET', '/users', (dynamic i) => User.fromJson(i),
82+
Stream<User> listUsers({int? pages, int? since}) => PaginationHelper(github)
83+
.objects('GET', '/users', (dynamic i) => User.fromJson(i),
8484
pages: pages, params: {'since': since});
8585

8686
/// Lists all email addresses for the currently authenticated user.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy