blob: f889ac223fb424cd512ab8dea608b2efe28bafe0 [file] [edit]
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:github/github.dart';
import 'package:glob/glob.dart';
import '../firehose.dart';
class LocalGithubApi implements GithubApi {
final Iterable<GitFile> files;
LocalGithubApi({
required this.prLabels,
required this.files,
});
@override
String? get actor => throw UnimplementedError();
@override
void appendStepSummary(String markdownSummary) {}
@override
String? get baseRef => throw UnimplementedError();
@override
void close() {}
@override
Future<int?> findCommentId({required String user, String? searchTerm}) {
throw UnimplementedError();
}
@override
Future<void> createComment(int issueNumber, String body) async {
throw UnimplementedError();
}
@override
Future<void> updateComment(int commentId, String body) async {
throw UnimplementedError();
}
@override
Future<bool> deleteComment(int commentId) => throw UnimplementedError();
@override
String? get githubAuthToken => throw UnimplementedError();
@override
bool get inGithubContext => false;
@override
int? get issueNumber => 1;
@override
Future<List<GitFile>> listFilesForPR(Directory directory,
[List<Glob> ignoredFiles = const []]) async =>
files
.where((element) =>
ignoredFiles.none((p0) => p0.matches(element.filename)))
.toList();
@override
void notice({required String message, String? file, int? line, int? col}) {}
@override
void warning({required String message, String? file, int? line, int? col}) {}
@override
void error({required String message, String? file, int? line, int? col}) {}
@override
final List<String> prLabels;
@override
Future<String> pullrequestBody() async => 'Test body';
@override
String? get refName => throw UnimplementedError();
@override
RepositorySlug? get repoSlug => RepositorySlug('test_owner', 'test_repo');
@override
String? get sha => 'test_sha';
}