Skip to content

Commit 5bfada3

Browse files
committed
Formatting
1 parent 5f9febb commit 5bfada3

22 files changed

+612
-698
lines changed

bin/raygun_cli.dart

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,12 @@ ArgParser buildParser() {
1717
negatable: false,
1818
help: 'Show additional command output.',
1919
)
20-
..addFlag(
21-
'version',
22-
negatable: false,
23-
help: 'Print the tool version.',
24-
)
25-
..addCommand(
26-
sourcemapCommand.name,
27-
sourcemapCommand.buildParser(),
28-
)
29-
..addCommand(
30-
symbolsCommand.name,
31-
symbolsCommand.buildParser(),
32-
)
33-
..addCommand(
34-
deploymentsCommand.name,
35-
deploymentsCommand.buildParser(),
36-
)
37-
..addCommand(
38-
proguardCommand.name,
39-
proguardCommand.buildParser(),
40-
)
41-
..addCommand(
42-
dsymCommand.name,
43-
dsymCommand.buildParser(),
44-
);
20+
..addFlag('version', negatable: false, help: 'Print the tool version.')
21+
..addCommand(sourcemapCommand.name, sourcemapCommand.buildParser())
22+
..addCommand(symbolsCommand.name, symbolsCommand.buildParser())
23+
..addCommand(deploymentsCommand.name, deploymentsCommand.buildParser())
24+
..addCommand(proguardCommand.name, proguardCommand.buildParser())
25+
..addCommand(dsymCommand.name, dsymCommand.buildParser());
4526
}
4627

4728
void printUsage(ArgParser argParser) {

lib/src/config_props.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ class ConfigProp {
2929
/// The environment variable key
3030
final String envKey;
3131

32-
const ConfigProp({
33-
required this.name,
34-
required this.envKey,
35-
});
32+
const ConfigProp({required this.name, required this.envKey});
3633

3734
/// Load the value of the property from arguments or environment variables
3835
String load(ArgResults arguments) {
@@ -45,7 +42,8 @@ class ConfigProp {
4542
if (value == null) {
4643
print('Error: Missing "$name"');
4744
print(
48-
' Please provide "$name" via argument or environment variable "$envKey"');
45+
' Please provide "$name" via argument or environment variable "$envKey"',
46+
);
4947
exit(2);
5048
}
5149
return value;

lib/src/deployments/deployments_api.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ class DeploymentsApi {
3535
'deployedAt': DateTime.now().toUtc().toIso8601String(),
3636
};
3737

38-
final request = RaygunPostRequestBuilder(url)
39-
.addBearerToken(token)
40-
.addJsonBody(payload)
41-
.build();
38+
final request = RaygunPostRequestBuilder(
39+
url,
40+
).addBearerToken(token).addJsonBody(payload).build();
4241

4342
try {
4443
final response = await httpClient.send(request);
@@ -47,7 +46,8 @@ class DeploymentsApi {
4746
if (response.statusCode == 200 || response.statusCode == 201) {
4847
print('Success creating deployment: ${response.statusCode}');
4948
print(
50-
'Deployment identifier: ${jsonDecode(responseBody)['identifier']}');
49+
'Deployment identifier: ${jsonDecode(responseBody)['identifier']}',
50+
);
5151
return true;
5252
}
5353

lib/src/deployments/deployments_command.dart

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import 'package:raygun_cli/src/core/raygun_command.dart';
55
import 'package:raygun_cli/src/deployments/deployments.dart';
66
import 'package:raygun_cli/src/deployments/deployments_api.dart';
77

8-
final DeploymentsCommand deploymentsCommand =
9-
DeploymentsCommand(api: DeploymentsApi.create());
8+
final DeploymentsCommand deploymentsCommand = DeploymentsCommand(
9+
api: DeploymentsApi.create(),
10+
);
1011

1112
class DeploymentsCommand extends RaygunCommand {
1213
const DeploymentsCommand({required this.api});
@@ -25,11 +26,7 @@ class DeploymentsCommand extends RaygunCommand {
2526
negatable: false,
2627
help: 'Print deployments usage information',
2728
)
28-
..addOption(
29-
'token',
30-
mandatory: true,
31-
help: 'Raygun access token',
32-
)
29+
..addOption('token', mandatory: true, help: 'Raygun access token')
3330
..addOption(
3431
'api-key',
3532
mandatory: true,
@@ -63,11 +60,7 @@ class DeploymentsCommand extends RaygunCommand {
6360
mandatory: false,
6461
help: 'Email address of the person deploying the software',
6562
)
66-
..addOption(
67-
'comment',
68-
mandatory: false,
69-
help: 'Deployment comment',
70-
);
63+
..addOption('comment', mandatory: false, help: 'Deployment comment');
7164
}
7265

7366
@override
@@ -78,19 +71,18 @@ class DeploymentsCommand extends RaygunCommand {
7871
exit(0);
7972
}
8073

81-
Deployments(
82-
command: command,
83-
verbose: verbose,
84-
deploymentsApi: api,
85-
).notify().then((success) {
86-
if (success) {
87-
exit(0);
88-
} else {
89-
exit(1);
90-
}
91-
}).catchError((error) {
92-
print('Error creating deployment: $error');
93-
exit(2);
94-
});
74+
Deployments(command: command, verbose: verbose, deploymentsApi: api)
75+
.notify()
76+
.then((success) {
77+
if (success) {
78+
exit(0);
79+
} else {
80+
exit(1);
81+
}
82+
})
83+
.catchError((error) {
84+
print('Error creating deployment: $error');
85+
exit(2);
86+
});
9587
}
9688
}

lib/src/dsym/dsym.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ class Dsym {
77
final bool verbose;
88
final DsymApi api;
99

10-
Dsym({
11-
required this.command,
12-
required this.verbose,
13-
required this.api,
14-
});
10+
Dsym({required this.command, required this.verbose, required this.api});
1511

1612
Future<bool> upload() async {
1713
if (!command.wasParsed('path')) {

lib/src/dsym/dsym_command.dart

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,13 @@ class DsymCommand extends RaygunCommand {
2424
negatable: false,
2525
help: 'Print dsym usage information',
2626
)
27-
..addOption(
28-
'app-id',
29-
mandatory: true,
30-
help: 'Raygun application ID',
31-
)
27+
..addOption('app-id', mandatory: true, help: 'Raygun application ID')
3228
..addOption(
3329
'external-access-token',
3430
mandatory: true,
3531
help: 'Raygun external access token',
3632
)
37-
..addOption(
38-
'path',
39-
mandatory: true,
40-
help: 'Path to the dSYM zip file',
41-
);
33+
..addOption('path', mandatory: true, help: 'Path to the dSYM zip file');
4234
}
4335

4436
@override
@@ -49,19 +41,18 @@ class DsymCommand extends RaygunCommand {
4941
exit(0);
5042
}
5143

52-
Dsym(
53-
command: command,
54-
verbose: verbose,
55-
api: api,
56-
).upload().then((success) {
57-
if (success) {
58-
exit(0);
59-
} else {
60-
exit(1);
61-
}
62-
}).catchError((error) {
63-
print('Error uploading dSYM file: $error');
64-
exit(2);
65-
});
44+
Dsym(command: command, verbose: verbose, api: api)
45+
.upload()
46+
.then((success) {
47+
if (success) {
48+
exit(0);
49+
} else {
50+
exit(1);
51+
}
52+
})
53+
.catchError((error) {
54+
print('Error uploading dSYM file: $error');
55+
exit(2);
56+
});
6657
}
6758
}

lib/src/proguard/proguard.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ class Proguard {
77
final bool verbose;
88
final ProguardApi api;
99

10-
Proguard({
11-
required this.command,
12-
required this.verbose,
13-
required this.api,
14-
});
10+
Proguard({required this.command, required this.verbose, required this.api});
1511

1612
Future<bool> upload() async {
1713
if (!command.wasParsed('path')) {

lib/src/proguard/proguard_api.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class ProguardApi {
4343

4444
if (response.statusCode == 200) {
4545
print(
46-
'Success uploading Proguard/R8 mapping file: ${response.statusCode}');
46+
'Success uploading Proguard/R8 mapping file: ${response.statusCode}',
47+
);
4748
print('Result: $responseBody');
4849
return true;
4950
}

lib/src/proguard/proguard_command.dart

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import 'package:raygun_cli/src/core/raygun_command.dart';
55
import 'package:raygun_cli/src/proguard/proguard.dart';
66
import 'package:raygun_cli/src/proguard/proguard_api.dart';
77

8-
final ProguardCommand proguardCommand =
9-
ProguardCommand(api: ProguardApi.create());
8+
final ProguardCommand proguardCommand = ProguardCommand(
9+
api: ProguardApi.create(),
10+
);
1011

1112
class ProguardCommand extends RaygunCommand {
1213
const ProguardCommand({required this.api});
@@ -25,11 +26,7 @@ class ProguardCommand extends RaygunCommand {
2526
negatable: false,
2627
help: 'Print proguard usage information',
2728
)
28-
..addOption(
29-
'app-id',
30-
mandatory: true,
31-
help: 'Raygun application ID',
32-
)
29+
..addOption('app-id', mandatory: true, help: 'Raygun application ID')
3330
..addOption(
3431
'external-access-token',
3532
mandatory: true,
@@ -60,19 +57,18 @@ class ProguardCommand extends RaygunCommand {
6057
exit(0);
6158
}
6259

63-
Proguard(
64-
command: command,
65-
verbose: verbose,
66-
api: api,
67-
).upload().then((success) {
68-
if (success) {
69-
exit(0);
70-
} else {
71-
exit(1);
72-
}
73-
}).catchError((error) {
74-
print('Error uploading ProGuard mapping file: $error');
75-
exit(2);
76-
});
60+
Proguard(command: command, verbose: verbose, api: api)
61+
.upload()
62+
.then((success) {
63+
if (success) {
64+
exit(0);
65+
} else {
66+
exit(1);
67+
}
68+
})
69+
.catchError((error) {
70+
print('Error uploading ProGuard mapping file: $error');
71+
exit(2);
72+
});
7773
}
7874
}

lib/src/sourcemap/sourcemap_api.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import 'package:http/http.dart' as http;
33
import 'package:raygun_cli/src/core/raygun_api.dart';
44

55
class SourcemapApi {
6-
const SourcemapApi({
7-
required this.httpClient,
8-
});
6+
const SourcemapApi({required this.httpClient});
97

108
/// Creates a new instance of [SourcemapApi] with the provided [httpClient].
119
SourcemapApi.create() : httpClient = http.Client();

0 commit comments

Comments
 (0)