-
Notifications
You must be signed in to change notification settings - Fork 7
/
dangerfile.dart
30 lines (25 loc) · 1007 Bytes
/
dangerfile.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import 'dart:io';
import 'package:path/path.dart' show join, current;
import 'package:danger_core/danger_core.dart';
import 'package:danger_plugin_dart_test/danger_plugin_dart_test.dart';
void main() async {
await DangerUtils.gitFetchBranch();
final fullDiff = await DangerUtils.getFullDiff(
targetBranch: 'origin/${DangerUtils.getTargetBranch()}');
message('There are ${fullDiff.length} changed files');
if (danger.isGitHub) {
if (danger.github.pr.title.contains('WIP') == true) {
warn('PR is considered WIP');
}
DangerPluginDartTest.processFile(
File(join(current, 'danger_core_report.json')));
DangerPluginDartTest.processFile(
File(join(current, 'danger_dart_report.json')));
DangerPluginDartTest.processFile(
File(join(current, 'danger_plugin_dart_test_report.json')));
DangerPluginDartTest.processFile(
File(join(current, 'danger_plugin_golden_reporter.json')));
} else {
message('Welcome to danger local');
}
}