Skip to content

Commit 8fe2916

Browse files
committed
Merge branch 'master' into misc/web-app-api-cleanup
2 parents a10ee7f + ba5b411 commit 8fe2916

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+136
-175
lines changed

analysis_options.yaml

Lines changed: 74 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,77 @@ analyzer:
88
# https://dart.dev/lints
99
linter:
1010
rules:
11-
- always_declare_return_types
12-
- annotate_overrides
13-
- avoid_empty_else
14-
- avoid_init_to_null
15-
- avoid_null_checks_in_equality_operators
16-
- avoid_relative_lib_imports
17-
- avoid_return_types_on_setters
18-
- avoid_shadowing_type_parameters
19-
- avoid_types_as_parameter_names
20-
- await_only_futures
21-
- camel_case_extensions
22-
- camel_case_types
23-
- cancel_subscriptions
24-
- close_sinks
25-
- collection_methods_unrelated_type
26-
- comment_references
27-
- constant_identifier_names
28-
- control_flow_in_finally
29-
- curly_braces_in_flow_control_structures
30-
- directives_ordering
31-
- empty_catches
32-
- empty_constructor_bodies
33-
- empty_statements
34-
- hash_and_equals
35-
- implementation_imports
36-
- library_names
37-
- library_prefixes
38-
- literal_only_boolean_expressions
39-
- no_duplicate_case_values
40-
- non_constant_identifier_names
41-
- null_closures
42-
#- omit_local_variable_types
43-
- one_member_abstracts
44-
- only_throw_errors
45-
- overridden_fields
46-
- package_names
47-
- package_prefixed_library_names
48-
- prefer_adjacent_string_concatenation
49-
- prefer_collection_literals
50-
- prefer_conditional_assignment
51-
- prefer_contains
52-
- prefer_final_fields
53-
- prefer_final_locals
54-
- prefer_for_elements_to_map_fromIterable
55-
- prefer_generic_function_type_aliases
56-
- prefer_if_null_operators
57-
- prefer_is_empty
58-
- prefer_is_not_empty
59-
- prefer_iterable_whereType
60-
- prefer_null_aware_operators
61-
- prefer_single_quotes
62-
- prefer_spread_collections
63-
- prefer_typing_uninitialized_variables
64-
- recursive_getters
65-
- slash_for_doc_comments
66-
- test_types_in_equals
67-
- throw_in_finally
68-
- type_init_formals
69-
- unawaited_futures
70-
- unnecessary_brace_in_string_interps
71-
- unnecessary_const
72-
- unnecessary_getters_setters
73-
- unnecessary_new
74-
- unnecessary_null_in_if_null_operators
75-
- unnecessary_this
76-
- unrelated_type_equality_checks
77-
- use_function_type_syntax_for_parameters
78-
- use_rethrow_when_possible
79-
- valid_regexps
11+
- always_declare_return_types
12+
- annotate_overrides
13+
- avoid_empty_else
14+
- avoid_init_to_null
15+
- avoid_null_checks_in_equality_operators
16+
- avoid_relative_lib_imports
17+
- avoid_return_types_on_setters
18+
- avoid_shadowing_type_parameters
19+
- avoid_types_as_parameter_names
20+
- await_only_futures
21+
- camel_case_extensions
22+
- camel_case_types
23+
- cancel_subscriptions
24+
- close_sinks
25+
- collection_methods_unrelated_type
26+
- comment_references
27+
- constant_identifier_names
28+
- control_flow_in_finally
29+
- curly_braces_in_flow_control_structures
30+
- dangling_library_doc_comments
31+
- directives_ordering
32+
- empty_catches
33+
- empty_constructor_bodies
34+
- empty_statements
35+
- hash_and_equals
36+
- implementation_imports
37+
- library_annotations
38+
- library_names
39+
- library_prefixes
40+
- literal_only_boolean_expressions
41+
- no_duplicate_case_values
42+
- non_constant_identifier_names
43+
- null_closures
44+
#- omit_local_variable_types
45+
- one_member_abstracts
46+
- only_throw_errors
47+
- overridden_fields
48+
- package_names
49+
- package_prefixed_library_names
50+
- prefer_adjacent_string_concatenation
51+
- prefer_collection_literals
52+
- prefer_conditional_assignment
53+
- prefer_contains
54+
- prefer_final_fields
55+
- prefer_final_locals
56+
- prefer_for_elements_to_map_fromIterable
57+
- prefer_generic_function_type_aliases
58+
- prefer_if_null_operators
59+
- prefer_is_empty
60+
- prefer_is_not_empty
61+
- prefer_iterable_whereType
62+
- prefer_null_aware_operators
63+
- prefer_single_quotes
64+
- prefer_spread_collections
65+
- prefer_typing_uninitialized_variables
66+
- recursive_getters
67+
- slash_for_doc_comments
68+
- test_types_in_equals
69+
- throw_in_finally
70+
- type_init_formals
71+
- unawaited_futures
72+
- unnecessary_brace_in_string_interps
73+
- unnecessary_const
74+
- unnecessary_getters_setters
75+
- unnecessary_library_name
76+
- unnecessary_library_directive
77+
- unnecessary_new
78+
- unnecessary_null_in_if_null_operators
79+
- unnecessary_this
80+
- unrelated_type_equality_checks
81+
- use_function_type_syntax_for_parameters
82+
- use_rethrow_when_possible
83+
- use_string_in_part_of_directives
84+
- valid_regexps

app/lib/account/session_cookie.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
/// Logic to do with session cookie parsing and reading.
6-
library session_cookie;
6+
library;
77

88
import 'dart:io' show HttpHeaders;
99

app/lib/admin/tools/delete_all_staging.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Future<void> _batchedQuery<T extends Model>(
8787

8888
void flush() {
8989
if (keys.isEmpty) return;
90-
fn(List.from(keys));
90+
fn(List.of(keys));
9191
keys.clear();
9292
budget = _defaultBudget;
9393
}

app/lib/admin/tools/recent_uploaders.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
/// Creates a report about recent uploaders.
6+
library;
67

78
import 'dart:async';
89
import 'dart:convert';

app/lib/fake/backend/fake_pub_worker.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import 'package:gcloud/service_scope.dart';
1515
import 'package:http/http.dart';
1616
import 'package:http_parser/http_parser.dart';
1717
import 'package:indexed_blob/indexed_blob.dart';
18-
import 'package:meta/meta.dart';
1918
import 'package:pana/pana.dart';
2019
import 'package:path/path.dart' as p;
2120
import 'package:pub_dev/fake/backend/fake_pana_runner.dart';
@@ -303,8 +302,7 @@ Future<void> _upload(
303302
);
304303
}, retryIf: (e) => e is IOException || e is IntermittentUploadException);
305304

306-
@sealed
307-
class UploadException implements Exception {
305+
final class UploadException implements Exception {
308306
final String message;
309307

310308
UploadException(this.message);
@@ -313,8 +311,7 @@ class UploadException implements Exception {
313311
String toString() => message;
314312
}
315313

316-
@sealed
317-
class IntermittentUploadException extends UploadException {
314+
final class IntermittentUploadException extends UploadException {
318315
IntermittentUploadException(String message) : super(message);
319316
}
320317

app/lib/frontend/handlers.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library pub_dartlang_org.handlers;
6-
75
import 'package:logging/logging.dart';
86
import 'package:shelf/shelf.dart' as shelf;
97
import 'package:shelf_router/shelf_router.dart';

app/lib/frontend/handlers/account.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ Future<LikedPackagesResponse> listPackageLikesHandler(
203203
final authenticatedUser = await requireAuthenticatedWebUser();
204204
final user = authenticatedUser.user;
205205
final packages = await likeBackend.listPackageLikes(user);
206-
final List<PackageLikeResponse> packageLikes = List.from(packages.map(
207-
(like) => PackageLikeResponse(
208-
liked: true, package: like.package, created: like.created)));
206+
final List<PackageLikeResponse> packageLikes = packages
207+
.map((like) => PackageLikeResponse(
208+
liked: true, package: like.package, created: like.created))
209+
.toList();
209210
return LikedPackagesResponse(likedPackages: packageLikes);
210211
}
211212

app/lib/frontend/handlers/atom_feed.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library pub_dartlang_org.atom_feed;
6-
75
import 'dart:async';
86
import 'dart:convert';
97

app/lib/frontend/handlers/custom_api.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,7 @@ Future<shelf.Response> apiSearchHandler(shelf.Request request) async {
461461
if (sr.errorMessage != null) 'message': sr.errorMessage,
462462
};
463463
if (hasNextPage) {
464-
final newParams =
465-
Map<String, dynamic>.from(request.requestedUri.queryParameters);
464+
final newParams = {...request.requestedUri.queryParameters};
466465
newParams['page'] = (searchForm.currentPage! + 1).toString();
467466
final nextPageUrl =
468467
request.requestedUri.replace(queryParameters: newParams).toString();

app/lib/frontend/handlers/redirects.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library pub_dartlang_org.handlers_redirects;
6-
75
import 'package:shelf/shelf.dart';
86
import 'package:shelf_router/shelf_router.dart';
97

0 commit comments

Comments
 (0)