Skip to content

Commit

Permalink
chore(repo): Add missing trailing commas (#3410)
Browse files Browse the repository at this point in the history
Analysis is failing on `beta` due to this.
  • Loading branch information
dnys1 committed Jul 28, 2023
1 parent cd16932 commit f14232e
Show file tree
Hide file tree
Showing 119 changed files with 368 additions and 365 deletions.
3 changes: 1 addition & 2 deletions canaries/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:amplified_todo/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:amplified_todo/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
Expand Down
2 changes: 1 addition & 1 deletion packages/aft/lib/src/commands/docs_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ abstract class _DocsSubcommand extends AmplifyCommand
'--fragment-dir-path=doc/.dart_tool/build/generated',
'--yaml',
'--write-in-place',
'lib'
'lib',
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const awsProtocols = [
'awsQuery',
'restJson1',
'restXml',
'restXmlWithNamespace'
'restXmlWithNamespace',
];

/// Command for generating the AWS SDK for a given package and `sdk.yaml` file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ jobs:

final androidPlatformPackagePaths = [
if (platformPackageAndroidTestDirExists)
'${repoRelativePath}_android/**/*'
'${repoRelativePath}_android/**/*',
];
final androidWorkflowPaths = [
'.github/workflows/$androidWorkflow',
p.relative(androidWorkflowFilepath, from: rootDir.path)
p.relative(androidWorkflowFilepath, from: rootDir.path),
];
final androidPathString =
(androidPlatformPackagePaths + androidWorkflowPaths)
Expand Down Expand Up @@ -396,11 +396,11 @@ jobs:
);

final iosPlatformPackagePaths = [
if (platformPackageDirExists) '${repoRelativePath}_ios/**/*'
if (platformPackageDirExists) '${repoRelativePath}_ios/**/*',
];
final iosWorkflowPaths = [
'.github/workflows/$iosWorkflow',
p.relative(iosWorkflowFilepath, from: rootDir.path)
p.relative(iosWorkflowFilepath, from: rootDir.path),
];
final iosPathString = (iosPlatformPackagePaths + iosWorkflowPaths)
.map((path) => " - '$path'")
Expand Down
2 changes: 1 addition & 1 deletion packages/aft/lib/src/commands/link_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Future<void> _createPubspecOverride(
'url': v.url.toString(),
if (ref != null) 'ref': ref,
if (path != null) 'path': path,
}
},
});
}
if (v is PathDependency) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aft/lib/src/repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class Repo {
dependent.pubspecInfo.pubspecYamlEditor.update(
[
if (hasDependency) 'dependencies' else 'dev_dependencies',
package.name
package.name,
],
newConstraint,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AmplifyPluginRegistry {

void _registerDefaultPlugins() {
_plugins.addAll({
for (var plugin in _defaultPlugins) plugin.name: plugin,
for (final plugin in _defaultPlugins) plugin.name: plugin,
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_core/lib/src/hub/amplify_hub_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class AmplifyHubImpl extends AmplifyHub {
]).ignore();
Future.wait<void>([
for (final subs in _subscriptions.values)
for (final sub in subs) sub.cancel()
for (final sub in subs) sub.cancel(),
]).ignore();
_availableStreams.clear();
_subscriptions.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class CognitoUserAttributeKey extends AuthUserAttributeKey {
sub,
updatedAt,
website,
zoneinfo
zoneinfo,
];

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class ConflictResolutionDecision {

Map<String, Object?> toJson() => <String, Object?>{
'resolutionStrategy': _resolutionStrategy.name,
'customModel': customModel?.toJson()
'customModel': customModel?.toJson(),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DataStoreSyncExpression {
return <String, dynamic>{
'id': id,
'modelName': _modelType.modelName(),
'queryPredicate': _queryPredicateResolver().serializeAsMap()
'queryPredicate': _queryPredicateResolver().serializeAsMap(),
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class QueryFieldOperator<T> {
) {
return <String, dynamic>{
'operatorName': operatorName,
'value': serializeDynamicValue(value)
'value': serializeDynamicValue(value),
};
}

Expand Down Expand Up @@ -360,7 +360,7 @@ class BetweenQueryOperator<T extends Comparable<Object?>>
return <String, dynamic>{
'operatorName': QueryFieldOperatorType.between.toShortString(),
'start': serializeDynamicValue(start),
'end': serializeDynamicValue(end)
'end': serializeDynamicValue(end),
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class QueryPredicateGroup extends QueryPredicate {
'queryPredicateGroup': <String, dynamic>{
'type': type.name,
'predicates':
predicates.map((predicate) => predicate.serializeAsMap()).toList()
predicates.map((predicate) => predicate.serializeAsMap()).toList(),
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_core/test/config/auth_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const expected = <String, CognitoAuthConfig>{
'email',
'openid',
'profile',
'aws.cognito.signin.user.admin'
'aws.cognito.signin.user.admin',
],
signInRedirectUri: OAUTH_SIGNIN,
signOutRedirectUri: OAUTH_SIGNOUT,
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_core/test/config/cli_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ const expected = {
),
},
),
)
),
};
4 changes: 2 additions & 2 deletions packages/amplify_core/test/config/unknown_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void main() {
'auth': {
'plugins': {
customPluginName: customPluginConfig,
}
}
},
},
};

final config = AmplifyConfig.fromJson(json);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void main() {
Map.fromEntries([
stringifiedBoolProperty,
stringProperty,
secondStringProperty
secondStringProperty,
]),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void main() {
location: location,
customProperties: properties,
userAttributes: {
stringProperty.key: [stringProperty.value, stringProperty.value]
stringProperty.key: [stringProperty.value, stringProperty.value],
},
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {

for (final environmentName in const [
'no-unauth-access',
'no-unauth-identities'
'no-unauth-identities',
]) {
testWidgets(environmentName, (_) async {
storageFactory(scope) => mockPersistedSecuredStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class _MyAppState extends State<MyApp> {
..addDoubleProperty('${_userId}_endpoint_doubleKey', 10)
..addBoolProperty('${_userId}_endpoint_boolKey', false),
userAttributes: {
'${_userId}_user_stringKey': ['stringValue', 'anotherStringValue']
'${_userId}_user_stringKey': ['stringValue', 'anotherStringValue'],
},
);

Expand Down Expand Up @@ -175,7 +175,7 @@ class _MyAppState extends State<MyApp> {
Center(
child:
Text('Is Amplify Configured?: $_amplifyConfigured\n'),
)
),
],
),
),
Expand Down Expand Up @@ -280,7 +280,7 @@ class _MyAppState extends State<MyApp> {
),
],
),
)
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void main() {
'1': EventItemResponse(
message: 'Retryable Exception',
statusCode: 500,
)
),
},
),
},
Expand Down Expand Up @@ -351,7 +351,7 @@ void main() {
'1': EventItemResponse(
message: 'ValidationException',
statusCode: 400,
)
),
},
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Future<void> configureAmplify() async {
macOSOptions: MacOSSecureStorageOptions(useDataProtection: false),
),
),
AmplifyAPI(modelProvider: ModelProvider.instance)
AmplifyAPI(modelProvider: ModelProvider.instance),
]);
await Amplify.configure(amplifyconfig);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/api/amplify_api/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class _MyAppState extends State<MyApp> {
ElevatedButton(
onPressed: _onGraphQlApiViewButtonClick,
child: const Text('GraphQL API'),
)
),
],
),
),
Expand Down
4 changes: 1 addition & 3 deletions packages/api/amplify_api/example/lib/widgets/auth_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class GraphQLAuthMode extends StatelessWidget {
icon: const Icon(Icons.arrow_downward),
isExpanded: true,
elevation: 16,
onChanged: (APIAuthorizationType? value) {
setAuthType(value!);
},
onChanged: (apiType) => setAuthType(apiType!),
items: authTypes.map<DropdownMenuItem<APIAuthorizationType>>(
(APIAuthorizationType value) {
return DropdownMenuItem<APIAuthorizationType>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main() {
ConnectivityStatus.connected,
ConnectivityStatus.connected,
ConnectivityStatus.disconnected,
ConnectivityStatus.connected
ConnectivityStatus.connected,
]),
);
stream.listen(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class GraphQLRequestFactory {
return <String, dynamic>{
'filter': filter,
'limit': limit,
'nextToken': nextToken
'nextToken': nextToken,
};
}

Expand Down Expand Up @@ -312,7 +312,7 @@ class GraphQLRequestFactory {
return <String, dynamic>{
fieldName: _queryFieldOperatorToPartialGraphQLFilter(
queryPredicate.queryFieldOperator,
)
),
};
}

Expand All @@ -329,7 +329,7 @@ class GraphQLRequestFactory {
typeExpression: queryPredicateToGraphQLFilter(
queryPredicate.predicates[0],
modelType,
)
),
};
}
// Public not() API only allows 1 condition but QueryPredicateGroup
Expand All @@ -346,7 +346,7 @@ class GraphQLRequestFactory {
(predicate) =>
queryPredicateToGraphQLFilter(predicate, modelType)!,
)
.toList()
.toList(),
};
}

Expand Down Expand Up @@ -443,15 +443,15 @@ Map<String, dynamic> _queryFieldOperatorToPartialGraphQLFilter(
final filterExpression = _getGraphQLFilterExpression(queryFieldOperator.type);
if (queryFieldOperator is QueryFieldOperatorSingleValue) {
return <String, dynamic>{
filterExpression: _getSerializedValue(queryFieldOperator.value)
filterExpression: _getSerializedValue(queryFieldOperator.value),
};
}
if (queryFieldOperator is BetweenQueryOperator) {
return <String, dynamic>{
filterExpression: <dynamic>[
_getSerializedValue(queryFieldOperator.start),
_getSerializedValue(queryFieldOperator.end)
]
_getSerializedValue(queryFieldOperator.end),
],
};
}

Expand All @@ -470,7 +470,7 @@ String _getGraphQLFilterExpression(QueryFieldOperatorType operatorType) {
QueryFieldOperatorType.greater_or_equal: 'ge',
QueryFieldOperatorType.between: 'between',
QueryFieldOperatorType.contains: 'contains',
QueryFieldOperatorType.begins_with: 'beginsWith'
QueryFieldOperatorType.begins_with: 'beginsWith',
};
final result = dictionary[operatorType];
if (result == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class GraphQLResponseDecoder {
if (resultNextToken != null) {
final variablesWithNextToken = <String, dynamic>{
...request.variables,
_nextToken: resultNextToken
_nextToken: resultNextToken,
};
requestForNextResult = GraphQLRequest<T>(
document: request.document,
Expand Down
6 changes: 3 additions & 3 deletions packages/api/amplify_api_dart/lib/src/graphql/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Map<String, dynamic> transformAppSyncJsonToModelJson(
_serializedData: transformAppSyncJsonToModelJson(
e as Map<String, dynamic>,
parentSchema,
)
),
},
)
.toList();
Expand All @@ -155,7 +155,7 @@ Map<String, dynamic> transformAppSyncJsonToModelJson(
_serializedData: transformAppSyncJsonToModelJson(
parentData as Map<String, dynamic>,
parentSchema,
)
),
};
});
}
Expand All @@ -174,7 +174,7 @@ Map<String, dynamic> transformAppSyncJsonToModelJson(
_serializedData: transformAppSyncJsonToModelJson(
item as Map<String, dynamic>,
childSchema,
)
),
},
)
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class SubscriptionRegistrationPayload extends WebSocketMessagePayload {
{'variables': request.variables, 'query': request.document},
),
'extensions': <String, Map<String, String>>{
'authorization': authorizationHeaders
}
'authorization': authorizationHeaders,
},
};
}
}
Expand Down
Loading

0 comments on commit f14232e

Please sign in to comment.