@@ -17,16 +17,17 @@ Future<void> main(List<String> arguments) async {
17
17
var gitUri = arguments[1 ].replaceRange (0 , 'git' .length, 'https' );
18
18
gitUri = gitUri.substring (0 , gitUri.length - '.git' .length);
19
19
final branch = arguments[2 ];
20
- final lines = arguments[3 ].split ('\n ' );
21
- final labels = lines
22
- .sublist (1 , lines.length - 1 )
20
+ final labels = arguments[3 ]
21
+ .split ('\n ' )
23
22
.map ((e) => e.trim ())
24
23
.where ((line) => line.startsWith ('ecosystem-test' ));
25
24
print ('Labels: $labels ' );
26
25
final packages = fire.Repository ().locatePackages ();
27
26
//TODO: Possibly run for all packages, not just the first.
28
- final package = packages.firstWhereOrNull ((package) =>
29
- labels.any ((label) => label == 'ecosystem-test-${package .name }' ));
27
+ final package = packages.firstWhereOrNull (
28
+ (package) =>
29
+ labels.any ((label) => label == 'ecosystem-test-${package .name }' ),
30
+ );
30
31
if (package != null ) {
31
32
print ('Found $package . Embark on a quest!' );
32
33
final version = '${package .name }:${json .encode ({
@@ -35,25 +36,18 @@ Future<void> main(List<String> arguments) async {
35
36
'ref' : branch ,
36
37
'path' :
37
38
p .relative (package .directory .path , from : Directory .current .path )
38
- }
39
+ },
39
40
})}' ;
40
- final chronicles = await Quest (
41
- package.name,
42
- version,
43
- repositoriesFile,
44
- ).embark ();
41
+ final chronicles =
42
+ await Quest (package.name, version, repositoriesFile).embark ();
45
43
final comment = createComment (chronicles);
46
44
await writeComment (comment);
47
45
print (chronicles);
48
46
exitCode = chronicles.success ? 0 : 1 ;
49
47
}
50
48
}
51
49
52
- enum Level {
53
- solve,
54
- analyze,
55
- test;
56
- }
50
+ enum Level { solve, analyze, test }
57
51
58
52
/// The result of embarking on a quest. Stores the [package] which was tested
59
53
/// with its new [version] as well as the [chapters] of the chronicles, each
@@ -84,8 +78,10 @@ class Chapter {
84
78
85
79
bool get success => failure == null ;
86
80
87
- Level ? get failure => Level .values.firstWhereOrNull ((level) =>
88
- before[level]? .success == true && after[level]? .success == false );
81
+ Level ? get failure => Level .values.firstWhereOrNull (
82
+ (level) =>
83
+ before[level]? .success == true && after[level]? .success == false ,
84
+ );
89
85
90
86
String toRow (Application application) => '''
91
87
| ${application .name } | ${Level .values .map ((l ) => '${before [l ]?.success .toEmoji ?? '-' }/${after [l ]?.success .toEmoji ?? '-' }' ).join (' | ' )} |''' ;
@@ -179,8 +175,11 @@ class Quest {
179
175
await runFlutter (['clean' ], path);
180
176
181
177
print ('Rev package:$candidatePackage to version $version $application ' );
182
- final revSuccess =
183
- await runFlutter (['pub' , 'add' , version], path, true );
178
+ final revSuccess = await runFlutter (
179
+ ['pub' , 'add' , version],
180
+ path,
181
+ true ,
182
+ );
184
183
185
184
print ('Run checks for modified package' );
186
185
final resultAfter = await runChecks (path, application.level);
0 commit comments