diff --git a/_test/pubspec.yaml b/_test/pubspec.yaml index fd927214a..302b90e8e 100644 --- a/_test/pubspec.yaml +++ b/_test/pubspec.yaml @@ -9,7 +9,7 @@ dependencies: http: any dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 dependency_overrides: _discoveryapis_commons: diff --git a/analysis_options.yaml b/analysis_options.yaml index bc658787b..b86dd3303 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -15,18 +15,13 @@ linter: - avoid_unused_constructor_parameters - avoid_void_async - cancel_subscriptions - - comment_references - join_return_with_assignment - literal_only_boolean_expressions - missing_whitespace_between_adjacent_strings - no_runtimeType_toString - package_api_docs - - prefer_const_constructors - prefer_const_declarations - prefer_expression_function_bodies - prefer_final_locals - - prefer_relative_imports - - test_types_in_equals - unnecessary_breaks - use_string_buffers - - use_super_parameters diff --git a/config.yaml b/config.yaml index 78c668ce1..3a0feb939 100644 --- a/config.yaml +++ b/config.yaml @@ -10,7 +10,7 @@ packages: example: resources/googleapis/examples/main.dart mono_pkg: resources/googleapis/_mono_pkg.yaml extraDevDependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 googleapis_auth: ^1.0.0 apis: - abusiveexperiencereport:v1 # https://developers.google.com/abusive-experience-report/ diff --git a/discoveryapis_commons/lib/src/resumable_media_uploader.dart b/discoveryapis_commons/lib/src/resumable_media_uploader.dart index aa894563c..c12751f76 100644 --- a/discoveryapis_commons/lib/src/resumable_media_uploader.dart +++ b/discoveryapis_commons/lib/src/resumable_media_uploader.dart @@ -152,7 +152,7 @@ class ResumableMediaUploader { await validateResponse(response); - await response.stream.drain(); + await response.stream.drain(); final uploadUri = response.headers['location']; if (response.statusCode != 200 || uploadUri == null) { @@ -168,7 +168,7 @@ class ResumableMediaUploader { /// drained. Future _uploadChunkDrained(Uri uri, ResumableChunk chunk) async { final response = await _uploadChunkResumable(uri, chunk); - await response.stream.drain(); + await response.stream.drain(); } /// Does repeated attempts to upload [chunk]. @@ -183,7 +183,7 @@ class ResumableMediaUploader { final status = response.statusCode; if (attemptsLeft > 0 && (status == 500 || (502 <= status && status < 504))) { - await response.stream.drain(); + await response.stream.drain(); // Delay the next attempt. Default backoff function is exponential final failedAttempts = _options.numberOfAttempts - attemptsLeft; final duration = _options.backoffFunction(failedAttempts); @@ -194,17 +194,17 @@ class ResumableMediaUploader { '$status. Maximum number of retries reached.'); } - await Future.delayed(duration); + await Future.delayed(duration); return tryUpload(attemptsLeft - 1); } else if (!lastChunk && status != 308) { - await response.stream.drain(); + await response.stream.drain(); throw client_requests.DetailedApiRequestError( status, 'Resumable upload: Uploading a chunk resulted in status ' '$status instead of 308.', ); } else if (lastChunk && status != 201 && status != 200) { - await response.stream.drain(); + await response.stream.drain(); throw client_requests.DetailedApiRequestError( status, 'Resumable upload: Uploading a chunk resulted in status ' diff --git a/discoveryapis_commons/pubspec.yaml b/discoveryapis_commons/pubspec.yaml index a78c28dca..1d3b8e5d2 100644 --- a/discoveryapis_commons/pubspec.yaml +++ b/discoveryapis_commons/pubspec.yaml @@ -12,5 +12,5 @@ dependencies: meta: ^1.3.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 diff --git a/discoveryapis_commons/test/discoveryapis_commons_test.dart b/discoveryapis_commons/test/discoveryapis_commons_test.dart index a4219d54b..d5d005c57 100644 --- a/discoveryapis_commons/test/discoveryapis_commons_test.dart +++ b/discoveryapis_commons/test/discoveryapis_commons_test.dart @@ -334,7 +334,8 @@ void main() { expect(media.length, equals(_data256.length)); expect( - await media.stream.fold([], (List b, d) => b..addAll(d)), + await media.stream + .fold>([], (List b, d) => b..addAll(d)), equals(_data256), ); }); @@ -365,7 +366,8 @@ void main() { expect(media.length, equals(data64.length)); expect( - await media.stream.fold([], (List b, d) => b..addAll(d)), + await media.stream + .fold>([], (List b, d) => b..addAll(d)), equals(data64), ); }); @@ -394,7 +396,8 @@ void main() { expect(media.contentType, equals('foobar')); expect(media.length, equals(_data256.length)); - final d = await media.stream.fold([], (List b, d) => b..addAll(d)); + final d = await media.stream + .fold>([], (List b, d) => b..addAll(d)); expect(d, equals(_data256)); }); }); @@ -529,7 +532,7 @@ void main() { { 'url': 'http://example.com/xyz?uploadType=resumable&alt=json', 'method': 'POST', - 'data': [], + 'data': [], 'headers': { 'content-length': '0', 'content-type': 'application/json; charset=utf-8', diff --git a/discoveryapis_generator/lib/src/apis_files_generator.dart b/discoveryapis_generator/lib/src/apis_files_generator.dart index 5fbbf6ff2..1363e649a 100644 --- a/discoveryapis_generator/lib/src/apis_files_generator.dart +++ b/discoveryapis_generator/lib/src/apis_files_generator.dart @@ -165,7 +165,9 @@ class ApisFilesGenerator { if (key == 'dependencies') { // patch up dependencies. var localValue = pubspec![key] as Map?; - localValue = localValue != null ? value = Map.from(localValue) : {}; + localValue = localValue != null + ? value = Map.from(localValue) + : {}; localValue.addAll(_computeNewDependencies(localValue)); value = localValue; } else { diff --git a/discoveryapis_generator/lib/src/dart_api_test_library.dart b/discoveryapis_generator/lib/src/dart_api_test_library.dart index 155747bb1..b5cf92c2f 100644 --- a/discoveryapis_generator/lib/src/dart_api_test_library.dart +++ b/discoveryapis_generator/lib/src/dart_api_test_library.dart @@ -784,7 +784,7 @@ $declaration buildUnnamed$_id() => } } -class UnnamedArrayTest extends UnnamedSchemaTest { +class UnnamedArrayTest extends UnnamedSchemaTest { UnnamedArrayTest(super.apiTestLibrary, super.schema); @override diff --git a/discoveryapis_generator/pubspec.yaml b/discoveryapis_generator/pubspec.yaml index 40b8b56d4..dd45fccc3 100644 --- a/discoveryapis_generator/pubspec.yaml +++ b/discoveryapis_generator/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: yaml: ^3.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.0.0 executables: diff --git a/discoveryapis_generator/test/dart_schemas_test.dart b/discoveryapis_generator/test/dart_schemas_test.dart index 3081b030d..99665e441 100644 --- a/discoveryapis_generator/test/dart_schemas_test.dart +++ b/discoveryapis_generator/test/dart_schemas_test.dart @@ -39,7 +39,8 @@ void main() { expect(db.dartClassTypes, hasLength(0)); }); - withParsedDB({'empty-schemas': {}}, (DartSchemaTypeDB db) { + withParsedDB({'empty-schemas': {}}, + (DartSchemaTypeDB db) { expect(db.dartTypes, hasLength(0)); expect(db.namedSchemaTypes, hasLength(0)); expect(db.dartClassTypes, hasLength(0)); diff --git a/generated/googleapis/pubspec.yaml b/generated/googleapis/pubspec.yaml index b5d12c50d..238a6bff4 100644 --- a/generated/googleapis/pubspec.yaml +++ b/generated/googleapis/pubspec.yaml @@ -9,6 +9,6 @@ dependencies: _discoveryapis_commons: ^1.0.0 http: ">=0.13.0 <2.0.0" dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 googleapis_auth: ^1.0.0 test: ^1.16.0 diff --git a/generator/lib/googleapis_generator.dart b/generator/lib/googleapis_generator.dart index ecaea64a9..f7bd0680b 100644 --- a/generator/lib/googleapis_generator.dart +++ b/generator/lib/googleapis_generator.dart @@ -132,7 +132,7 @@ $stack ' Trying again in $tryAgainLag second(s) – ' '${item.discoveryRestUrl}', ); - await Future.delayed(Duration(seconds: tryAgainLag)); + await Future.delayed(Duration(seconds: tryAgainLag)); continue; } } diff --git a/generator/pubspec.yaml b/generator/pubspec.yaml index 3c3e503be..be59e4630 100644 --- a/generator/pubspec.yaml +++ b/generator/pubspec.yaml @@ -13,7 +13,7 @@ dependencies: yaml: '>=2.1.0 <4.0.0' dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 dependency_overrides: _discoveryapis_commons: diff --git a/googleapis_auth/lib/src/auth_http_utils.dart b/googleapis_auth/lib/src/auth_http_utils.dart index f1798f991..9aa64c7ba 100644 --- a/googleapis_auth/lib/src/auth_http_utils.dart +++ b/googleapis_auth/lib/src/auth_http_utils.dart @@ -40,7 +40,7 @@ class AuthenticatedClient extends DelegatingClient implements AuthClient { final response = await baseClient.send(modifiedRequest); final wwwAuthenticate = response.headers['www-authenticate']; if (wwwAuthenticate != null) { - await response.stream.drain(); + await response.stream.drain(); throw AccessDeniedException( 'Access was denied ' '(www-authenticate header was: $wwwAuthenticate).', diff --git a/googleapis_auth/lib/src/browser_utils.dart b/googleapis_auth/lib/src/browser_utils.dart index 8d749df72..c9e73d31b 100644 --- a/googleapis_auth/lib/src/browser_utils.dart +++ b/googleapis_auth/lib/src/browser_utils.dart @@ -64,7 +64,7 @@ class _ScriptLoader { return _pendingInitialization!; } - final completer = Completer(); + final completer = Completer(); final timeout = Timer(callbackTimeout, () { _pendingInitialization = null; diff --git a/googleapis_auth/pubspec.yaml b/googleapis_auth/pubspec.yaml index 3152e3233..416c22e88 100644 --- a/googleapis_auth/pubspec.yaml +++ b/googleapis_auth/pubspec.yaml @@ -19,7 +19,7 @@ dev_dependencies: build_runner: ^2.0.0 build_test: ^2.0.0 build_web_compilers: '>=3.2.7 <5.0.0' - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 false_secrets: diff --git a/googleapis_auth/test/oauth2_flows/auth_code_test.dart b/googleapis_auth/test/oauth2_flows/auth_code_test.dart index 92f35481d..daa7819f7 100644 --- a/googleapis_auth/test/oauth2_flows/auth_code_test.dart +++ b/googleapis_auth/test/oauth2_flows/auth_code_test.dart @@ -188,7 +188,7 @@ void main() { try { final request = await ioClient.getUrl(authCodeCall); final response = await request.close(); - await response.drain(); + await response.drain(); } finally { closeMe(); } diff --git a/googleapis_auth/test/util_test.dart b/googleapis_auth/test/util_test.dart index dfba4f5ba..043913232 100644 --- a/googleapis_auth/test/util_test.dart +++ b/googleapis_auth/test/util_test.dart @@ -65,7 +65,7 @@ void main() { }); test('not a map', () async { - final body = []; + final body = []; final client = mockClient( (request) async => Response(jsonEncode(body), 200, headers: jsonContentType), diff --git a/resources/googleapis/pubspec.yaml b/resources/googleapis/pubspec.yaml index 36e780b6c..8c761d368 100644 --- a/resources/googleapis/pubspec.yaml +++ b/resources/googleapis/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: dependency_overrides: _discoveryapis_commons: path: ../../discoveryapis_commons - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 diff --git a/test_integration/pubspec.yaml b/test_integration/pubspec.yaml index 26d204efd..74d33eeec 100644 --- a/test_integration/pubspec.yaml +++ b/test_integration/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 build_web_compilers: '>=3.0.0 <5.0.0' - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 dependency_overrides: