Skip to content

Commit cb4c67f

Browse files
committed
Enable and fix library-related lints
1 parent 591b8b2 commit cb4c67f

27 files changed

+93
-102
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/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/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/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/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

app/lib/package/backend.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.backend;
6-
75
import 'dart:async';
86
import 'dart:io';
97

app/lib/package/model_properties.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.model_properties;
6-
75
import 'dart:convert';
86

97
import 'package:pana/pana.dart' show SdkConstraintStatus;

app/lib/package/models.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.appengine_repository.models;
6-
75
import 'dart:convert';
86

97
import 'package:_pub_shared/data/package_api.dart';

app/lib/package/upload_signer_service.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.upload_signer_service;
6-
75
import 'dart:async';
86
import 'dart:convert';
97

0 commit comments

Comments
 (0)