mirror of
https://github.com/flutter/flutter
synced 2024-08-28 04:21:14 +00:00
Migrate dartdoc to null safety (#84153)
This commit is contained in:
parent
e6aa6ce27f
commit
d90ee21271
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
|
@ -258,9 +256,9 @@ String getBranchName() {
|
|||
final ProcessResult gitResult = Process.runSync('git', <String>['status', '-b', '--porcelain']);
|
||||
if (gitResult.exitCode != 0)
|
||||
throw 'git status exit with non-zero exit code: ${gitResult.exitCode}';
|
||||
final Match gitBranchMatch = gitBranchRegexp.firstMatch(
|
||||
final RegExpMatch? gitBranchMatch = gitBranchRegexp.firstMatch(
|
||||
(gitResult.stdout as String).trim().split('\n').first);
|
||||
return gitBranchMatch == null ? '' : gitBranchMatch.group(1).split('...').first;
|
||||
return gitBranchMatch == null ? '' : gitBranchMatch.group(1)!.split('...').first;
|
||||
}
|
||||
|
||||
String gitRevision() {
|
||||
|
@ -314,7 +312,7 @@ void createSearchMetadata(String templatePath, String metadataPath) {
|
|||
/// specified, for each source/destination file pair.
|
||||
///
|
||||
/// Creates `destDir` if needed.
|
||||
void copyDirectorySync(Directory srcDir, Directory destDir, [void Function(File srcFile, File destFile) onFileCopied]) {
|
||||
void copyDirectorySync(Directory srcDir, Directory destDir, [void Function(File srcFile, File destFile)? onFileCopied]) {
|
||||
if (!srcDir.existsSync())
|
||||
throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy');
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
@ -82,7 +80,7 @@ void checkForUnresolvedDirectives(String htmlOutputPath) {
|
|||
int _scanFile(File file) {
|
||||
assert(path.extension(file.path) == '.html');
|
||||
final Iterable<String> matches = _pattern.allMatches(file.readAsStringSync())
|
||||
.map((RegExpMatch m ) => m.group(0));
|
||||
.map((RegExpMatch m ) => m.group(0)!);
|
||||
|
||||
if (matches.isNotEmpty) {
|
||||
stderr.writeln('Found unresolved dartdoc directives in ${file.path}:');
|
||||
|
|
Loading…
Reference in a new issue