Skip to content

Commit 8d8b198

Browse files
authored
Use and fix core lints across workspace (#8331)
1 parent 8021b48 commit 8d8b198

File tree

15 files changed

+29
-42
lines changed

15 files changed

+29
-42
lines changed

analysis_options.yaml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include: package:lints/core.yaml
2+
13
# https://dart.dev/tools/analysis
24
analyzer:
35
exclude:
@@ -10,36 +12,21 @@ linter:
1012
rules:
1113
- always_declare_return_types
1214
- annotate_overrides
13-
- avoid_empty_else
1415
- avoid_init_to_null
1516
- avoid_null_checks_in_equality_operators
16-
- avoid_relative_lib_imports
1717
- 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
2318
- cancel_subscriptions
2419
- close_sinks
25-
- collection_methods_unrelated_type
2620
- comment_references
2721
- constant_identifier_names
2822
- control_flow_in_finally
29-
- curly_braces_in_flow_control_structures
30-
- dangling_library_doc_comments
3123
- directives_ordering
32-
- empty_catches
3324
- empty_constructor_bodies
3425
- empty_statements
35-
- hash_and_equals
3626
- implementation_imports
37-
- library_annotations
3827
- library_names
3928
- library_prefixes
4029
- literal_only_boolean_expressions
41-
- no_duplicate_case_values
42-
- non_constant_identifier_names
4330
- null_closures
4431
#- omit_local_variable_types
4532
- one_member_abstracts
@@ -55,15 +42,10 @@ linter:
5542
- prefer_final_in_for_each
5643
- prefer_final_locals
5744
- prefer_for_elements_to_map_fromIterable
58-
- prefer_generic_function_type_aliases
5945
- prefer_if_null_operators
60-
- prefer_is_empty
61-
- prefer_is_not_empty
62-
- prefer_iterable_whereType
6346
- prefer_null_aware_operators
6447
- prefer_single_quotes
6548
- prefer_spread_collections
66-
- prefer_typing_uninitialized_variables
6749
- recursive_getters
6850
- slash_for_doc_comments
6951
- test_types_in_equals
@@ -79,8 +61,5 @@ linter:
7961
- unnecessary_new
8062
- unnecessary_null_in_if_null_operators
8163
- unnecessary_this
82-
- unrelated_type_equality_checks
8364
- use_function_type_syntax_for_parameters
8465
- use_rethrow_when_possible
85-
- use_string_in_part_of_directives
86-
- valid_regexps

app/lib/admin/actions/actions.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
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-
import 'package:pub_dev/admin/actions/exported-api-sync.dart';
6-
75
import '../../shared/exceptions.dart';
86
import 'download_counts_backfill.dart';
97
import 'download_counts_delete.dart';
108
import 'email_send.dart';
9+
import 'exported_api_sync.dart';
1110
import 'merge_moderated_package_into_existing.dart';
1211
import 'moderate_package.dart';
1312
import 'moderate_package_versions.dart';

app/lib/shared/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Future<T> withTempDirectory<T>(Future<T> Function(Directory dir) func,
4040
{String prefix = 'dart-tempdir'}) {
4141
return Directory.systemTemp.createTemp(prefix).then((Directory dir) {
4242
return func(dir).whenComplete(() {
43-
return dir.delete(recursive: true);
43+
dir.delete(recursive: true);
4444
});
4545
});
4646
}

app/pubspec.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
basics: ^0.10.0
1212
chunked_stream: ^1.1.0
1313
clock: ^1.1.0
14-
collection: ^1.15.0-nullsafety.4
14+
collection: ^1.18.0
1515
convert: '^3.0.0'
1616
crypto: '^3.0.0'
1717
fake_async: ^1.2.0
@@ -26,11 +26,10 @@ dependencies:
2626
indexed_blob:
2727
intl: '^0.19.0'
2828
json_annotation: '^4.3.0'
29-
lints: ^5.0.0
3029
logging: '>=0.9.3 <2.0.0'
3130
markdown: ^7.2.2
3231
meta: ^1.1.2
33-
mime: '>=0.9.3 <2.0.0'
32+
mime: ^1.0.6
3433
neat_cache: ^2.0.4
3534
neat_periodic_task: ^2.0.0
3635
path: '^1.8.0'
@@ -46,7 +45,7 @@ dependencies:
4645
stack_trace: ^1.10.0
4746
stream_transform: ^2.0.0
4847
watcher: ^1.0.0
49-
yaml: '^3.0.0'
48+
yaml: ^3.1.0
5049
# pana version to be pinned
5150
pana: '0.22.15'
5251
# 3rd-party packages with pinned versions

pkg/_pub_shared/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ resolution: workspace
88
dependencies:
99
clock: ^1.1.0
1010
html: ^0.15.0
11+
http: ^1.0.0
1112
json_annotation: ^4.3.0
1213
logging: ^1.2.0
1314
meta: ^1.3.0

pkg/api_builder/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ environment:
77
resolution: workspace
88

99
dependencies:
10+
analyzer: ^6.0.0
1011
build: ^2.0.0
1112
build_config: ^1.0.0
13+
collection: ^1.18.0
1214
source_gen: ^1.0.0
13-
analyzer: ^6.0.0
1415
shelf_router: ^1.0.0
1516
code_builder: ^4.0.0
1617
shelf: ^1.0.0

pkg/code_coverage/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resolution: workspace
77

88
dependencies:
99
args: ^2.0.0
10-
collection: ^1.17.2
10+
collection: ^1.18.0
1111
coverage: ^1.3.2
1212
lcov_dart: ^7.0.0
1313
path: ^1.8.0

pkg/fake_gcloud/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ environment:
77
resolution: workspace
88

99
dependencies:
10+
clock: ^1.1.0
11+
crypto: ^3.0.0
1012
gcloud: ^0.8.18
1113
logging: '>=0.11.3 <2.0.0'
12-
clock: ^1.1.0
14+
_discoveryapis_commons: ^1.0.7
1315

1416
dev_dependencies:
1517
coverage: any # test already depends on it

pkg/pub_package_reader/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ resolution: workspace
99
dependencies:
1010
clock: ^1.1.0
1111
logging: '>=0.11.3+1 <2.0.0'
12+
path: ^1.8.0
1213
pub_semver: ^2.0.0
1314
pubspec_parse: '>=0.1.4 <2.0.0'
14-
yaml: ^3.0.0
15+
yaml: ^3.1.0
1516
yaml_edit: ^2.0.1
1617
tar: ^2.0.0
17-
collection: ^1.15.0-nullsafety.4
18+
collection: ^1.18.0
1819

1920
dev_dependencies:
2021
coverage: any # test already depends on it

0 commit comments

Comments
 (0)