Skip to content

Commit f48f440

Browse files
committed
format
1 parent dcdb46b commit f48f440

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

script/tool/lib/src/branch_for_batch_release_command.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import 'common/repository_package.dart';
1818
const int _kExitPackageMalformed = 3;
1919
const int _kGitFailedToPush = 4;
2020

21-
2221
/// A command to create a remote branch with release changes for a single package.
2322
class BranchForBatchReleaseCommand extends PackageCommand {
2423
/// Creates a new `branch-for-batch-release` command.
@@ -65,10 +64,9 @@ class BranchForBatchReleaseCommand extends PackageCommand {
6564
final GitDir repository = await gitDir;
6665

6766
print('Parsing package "${package.displayName}"...');
68-
final List<PendingChangelogEntry> pendingChangelogs =
69-
<PendingChangelogEntry>[];
67+
final List<PendingChangelogEntry> pendingChangelogs;
7068
try {
71-
pendingChangelogs.addAll(package.getPendingChangelogs());
69+
pendingChangelogs = package.getPendingChangelogs();
7270
} on FormatException catch (e) {
7371
printError('Failed to parse pending changelogs: ${e.message}');
7472
throw ToolExit(_kExitPackageMalformed);
@@ -112,8 +110,7 @@ class BranchForBatchReleaseCommand extends PackageCommand {
112110
/// This method read through the parsed changelog entries decide the new version
113111
/// by following the version change rules. See [_VersionChange] for more details.
114112
_ReleaseInfo _getReleaseInfo(
115-
List<PendingChangelogEntry> pendingChangelogEntries,
116-
Version oldVersion) {
113+
List<PendingChangelogEntry> pendingChangelogEntries, Version oldVersion) {
117114
final List<String> changelogs = <String>[];
118115
int versionIndex = VersionChange.skip.index;
119116
for (final PendingChangelogEntry entry in pendingChangelogEntries) {
@@ -126,8 +123,7 @@ class BranchForBatchReleaseCommand extends PackageCommand {
126123
final Version? newVersion = switch (effectiveVersionChange) {
127124
VersionChange.skip => null,
128125
VersionChange.major => Version(oldVersion.major + 1, 0, 0),
129-
VersionChange.minor =>
130-
Version(oldVersion.major, oldVersion.minor + 1, 0),
126+
VersionChange.minor => Version(oldVersion.major, oldVersion.minor + 1, 0),
131127
VersionChange.patch =>
132128
Version(oldVersion.major, oldVersion.minor, oldVersion.patch + 1),
133129
};
@@ -238,8 +234,6 @@ class BranchForBatchReleaseCommand extends PackageCommand {
238234
}
239235
}
240236

241-
242-
243237
/// A data class for processed release information.
244238
class _ReleaseInfo {
245239
/// Creates a new instance.

script/tool/lib/src/common/repository_package.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class RepositoryPackage {
129129
: null;
130130

131131
/// Returns the parsed [ciConfigFile], or null if it does not exist.
132-
///
132+
///
133133
/// Throws if the file exists but is not a valid ci_config.yaml.
134134
CiConfig? parseCiConfig() => _parsedCiConfig;
135135

@@ -284,7 +284,7 @@ class CiConfig {
284284
CiConfig._(this.isBatchRelease);
285285

286286
/// Parses a [CiConfig] from a YAML string.
287-
///
287+
///
288288
/// Throws if the YAML is not a valid ci_config.yaml.
289289
factory CiConfig._parse(String yaml) {
290290
final Object? loaded = loadYaml(yaml);
@@ -312,8 +312,6 @@ class CiConfig {
312312
/// Returns true if the package is configured for batch release.
313313
final bool isBatchRelease;
314314

315-
316-
317315
static void _checkCiConfigEntries(YamlMap config,
318316
{required Map<String, Object?> syntax, String configPrefix = ''}) {
319317
for (final MapEntry<Object?, Object?> entry in config.entries) {
@@ -372,7 +370,7 @@ class PendingChangelogEntry {
372370
{required this.changelog, required this.version, required this.file});
373371

374372
/// Creates a PendingChangelogEntry from a YAML string.
375-
///
373+
///
376374
/// Throws if the YAML is not a valid pending changelog entry.
377375
factory PendingChangelogEntry._parse(String yamlContent, File file) {
378376
final dynamic yaml = loadYaml(yamlContent);

script/tool/lib/src/repo_package_info_check_command.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import 'common/repository_package.dart';
1212
const int _exitBadTableEntry = 3;
1313
const int _exitUnknownPackageEntry = 4;
1414

15-
1615
/// A command to verify repository-level metadata about packages, such as
1716
/// repo README and CODEOWNERS entries.
1817
class RepoPackageInfoCheckCommand extends PackageLoopingCommand {
@@ -248,8 +247,6 @@ class RepoPackageInfoCheckCommand extends PackageLoopingCommand {
248247
return errors;
249248
}
250249

251-
252-
253250
String _prTagForPackage(String packageName) => 'p: $packageName';
254251

255252
String _issueTagForPackage(String packageName) {

script/tool/test/repo_package_info_check_command_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,7 @@ release:
603603
expect(
604604
output,
605605
containsAllInOrder(<Matcher>[
606-
contains(
607-
'No pending_changelogs folder found for a_package.'),
606+
contains('No pending_changelogs folder found for a_package.'),
608607
]),
609608
);
610609
});

0 commit comments

Comments
 (0)