Skip to content

Commit

Permalink
chore(aft): Fix analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Nys authored and dnys1 committed Sep 12, 2023
1 parent de9eaa4 commit b7279e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 29 deletions.
22 changes: 0 additions & 22 deletions packages/aft/lib/src/commands/amplify_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import 'package:git/git.dart' as git;
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart';
import 'package:yaml_edit/yaml_edit.dart';

/// Base class for all commands in this package providing common functionality.
abstract class AmplifyCommand extends Command<void>
Expand Down Expand Up @@ -202,23 +200,3 @@ abstract class AmplifyCommand extends Command<void>
httpClient.close();
}
}

extension on YamlEditor {
/// Merges [node] into `this` at the given [path].
///
/// This differs from [update] in that it recurses into the tree to only add
/// or override leaf nodes (i.e. [YamlScalar] values) for maps.
///
/// Lists cannot be safely merged, so they are overridden as with [update].
void merge(YamlNode node, [List<Object?> path = const []]) {
if (node is YamlMap) {
for (final key in node.keys) {
merge(node.nodes[key]!, [...path, key]);
}
return;
} else if (node is YamlList) {
safePrint('WARNING: Cannot merge YAML list values');
}
update(path, node);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ class GenerateGoldensCommand extends AmplifyCommand {
'software.amazon.smithy:smithy-aws-traits:$latestVersion',
'software.amazon.smithy:smithy-mqtt-traits:$latestVersion',
'software.amazon.smithy:smithy-protocol-test-traits:$latestVersion',
'software.amazon.smithy:smithy-validation-model:$latestVersion'
]
'software.amazon.smithy:smithy-validation-model:$latestVersion',
],
}),
);
final smithyVersion = File(p.join(goldensRoot, 'smithy-version'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class GenerateSdkCommand extends AmplifyCommand with GlobOptions {
(p) => p
..toThis = true
..name = 'service',
)
),
]),
),
)
Expand All @@ -323,7 +323,7 @@ class GenerateSdkCommand extends AmplifyCommand with GlobOptions {
..docs.add('/// The SigV4 service name, used in signing.')
..name = 'service'
..type = refer('String'),
)
),
]);

final modelsDir = await _modelsDirForRef('master');
Expand Down
2 changes: 1 addition & 1 deletion packages/aft/lib/src/constraints_checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ final class PublishConstraintsChecker extends ConstraintsChecker {
package: package,
dependencyPath: [
package.dependencyType(repoDependency)!.key,
repoDependency.name
repoDependency.name,
],
expectedConstraint: package.isPublishable
? repoDependency.currentConstraint
Expand Down
4 changes: 2 additions & 2 deletions packages/aft/test/config/config_loader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ aft:
d.dir('packages', [
d.dir('my_pkg', [
d.file('pubspec.yaml', packagePubspec),
])
])
]),
]),
]).create();

final rootDirectory = p.normalize(d.path('repo'));
Expand Down

0 comments on commit b7279e4

Please sign in to comment.