Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 74 additions & 69 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,77 @@ analyzer:
# https://dart.dev/lints
linter:
rules:
- always_declare_return_types
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- close_sinks
- collection_methods_unrelated_type
- comment_references
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- library_names
- library_prefixes
- literal_only_boolean_expressions
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
#- omit_local_variable_types
- one_member_abstracts
- only_throw_errors
- overridden_fields
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_null_aware_operators
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- recursive_getters
- slash_for_doc_comments
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unawaited_futures
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- valid_regexps
- always_declare_return_types
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_relative_lib_imports
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- await_only_futures
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- close_sinks
- collection_methods_unrelated_type
- comment_references
- constant_identifier_names
- control_flow_in_finally
- curly_braces_in_flow_control_structures
- dangling_library_doc_comments
- directives_ordering
- empty_catches
- empty_constructor_bodies
- empty_statements
- hash_and_equals
- implementation_imports
- library_annotations
- library_names
- library_prefixes
- literal_only_boolean_expressions
- no_duplicate_case_values
- non_constant_identifier_names
- null_closures
#- omit_local_variable_types
- one_member_abstracts
- only_throw_errors
- overridden_fields
- package_names
- package_prefixed_library_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_final_fields
- prefer_final_locals
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_null_aware_operators
- prefer_single_quotes
- prefer_spread_collections
- prefer_typing_uninitialized_variables
- recursive_getters
- slash_for_doc_comments
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unawaited_futures
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_getters_setters
- unnecessary_library_name
- unnecessary_library_directive
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible
- use_string_in_part_of_directives
- valid_regexps
2 changes: 1 addition & 1 deletion app/lib/account/session_cookie.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

/// Logic to do with session cookie parsing and reading.
library session_cookie;
library;

import 'dart:io' show HttpHeaders;

Expand Down
1 change: 1 addition & 0 deletions app/lib/admin/tools/recent_uploaders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

/// Creates a report about recent uploaders.
library;

import 'dart:async';
import 'dart:convert';
Expand Down
2 changes: 0 additions & 2 deletions app/lib/frontend/handlers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.handlers;

import 'package:logging/logging.dart';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf_router/shelf_router.dart';
Expand Down
2 changes: 0 additions & 2 deletions app/lib/frontend/handlers/atom_feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.atom_feed;

import 'dart:async';
import 'dart:convert';

Expand Down
2 changes: 0 additions & 2 deletions app/lib/frontend/handlers/redirects.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.handlers_redirects;

import 'package:shelf/shelf.dart';
import 'package:shelf_router/shelf_router.dart';

Expand Down
2 changes: 0 additions & 2 deletions app/lib/package/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.backend;

import 'dart:async';
import 'dart:io';

Expand Down
2 changes: 0 additions & 2 deletions app/lib/package/model_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.model_properties;

import 'dart:convert';

import 'package:pana/pana.dart' show SdkConstraintStatus;
Expand Down
2 changes: 0 additions & 2 deletions app/lib/package/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.appengine_repository.models;

import 'dart:convert';

import 'package:_pub_shared/data/package_api.dart';
Expand Down
2 changes: 0 additions & 2 deletions app/lib/package/upload_signer_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.upload_signer_service;

import 'dart:async';
import 'dart:convert';

Expand Down
1 change: 1 addition & 0 deletions app/lib/service/openid/asn1_encoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/// - https://pub.dev/packages/asn1lib
/// - https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/
/// - https://lapo.it/asn1js/
library;

import 'package:meta/meta.dart';

Expand Down
2 changes: 1 addition & 1 deletion app/lib/shared/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
///
/// All messages may contain markdown, and should be sensible for human
/// consumption.
library exceptions;
library;

import 'dart:io';

Expand Down
2 changes: 0 additions & 2 deletions app/lib/shared/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.utils;

import 'dart:async';
import 'dart:collection';
import 'dart:convert';
Expand Down
1 change: 1 addition & 0 deletions app/test/ensure_all_pub_get_is_clean_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

@Tags(['build'])
library;

import 'dart:io';

Expand Down
1 change: 1 addition & 0 deletions app/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@Timeout.factor(2)
@Tags(['build', 'presubmit-only'])
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
2 changes: 0 additions & 2 deletions app/test/frontend/handlers/_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.frontend.handlers_test;

import 'dart:async';
import 'dart:convert';

Expand Down
2 changes: 1 addition & 1 deletion app/test/package/backend_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

@Timeout(Duration(seconds: 15))
library pub_dartlang_org.backend_test;
library;

import 'dart:async';

Expand Down
2 changes: 0 additions & 2 deletions app/test/package/backend_test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.backend_test_utils;

import 'dart:async';
import 'dart:io';

Expand Down
2 changes: 0 additions & 2 deletions app/test/package/tarball_storage_namer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library pub_dartlang_org.tarball_storage_namer_test;

import 'package:gcloud/storage.dart';
import 'package:pub_dev/package/backend.dart';
import 'package:pub_dev/shared/configuration.dart';
Expand Down
2 changes: 2 additions & 0 deletions app/test/service/openid/github_actions_id_token_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.

@Tags(['presubmit-only'])
library;

import 'dart:convert';
import 'dart:io';

Expand Down
2 changes: 2 additions & 0 deletions app/test/task/cloudcompute/googlecloudcompute_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// slow, and something that could throw all sorts of exceptions, we don't want
// run this as part of normal testing.
@Tags(['fragile'])
library;

import 'dart:async';

import 'package:appengine/appengine.dart';
Expand Down
2 changes: 0 additions & 2 deletions pkg/_popularity/lib/popularity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library package_popularity;

import 'package:json_annotation/json_annotation.dart';

part 'popularity.g.dart';
Expand Down
1 change: 1 addition & 0 deletions pkg/_popularity/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@Timeout.factor(2)
@Tags(['presubmit-only'])
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
1 change: 1 addition & 0 deletions pkg/_pub_shared/test/ensure_build_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@Timeout.factor(2)
@Tags(['presubmit-only'])
library;

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
Expand Down
2 changes: 1 addition & 1 deletion pkg/api_builder/lib/_client_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

/// Utilities for use in generated client code.
library client_utils;
library;

import 'dart:async';
import 'dart:convert';
Expand Down
6 changes: 3 additions & 3 deletions pkg/indexed_blob/lib/indexed_blob.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// The `indexed_blob` library provides support for reading and writing
/// indexed-blobs.
/// The `indexed_blob.dart` library provides support for
/// reading and writing indexed-blobs.
///
/// An _indexed blob_ is a blob-file and an index-file pointing into the blob.
/// The index-file can be used to find _start_ and _end_ offset for a file
Expand All @@ -16,7 +16,7 @@
///
/// To goal of this format is to support storing the many small files generated
/// by `dartdoc` as an indexed-blob.
library indexed_blob;
library;

import 'dart:async';
import 'dart:convert' show utf8;
Expand Down
4 changes: 2 additions & 2 deletions pkg/pub_worker/lib/src/testing/server.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A test server for pub_worker
library server;
/// A test server for pub_worker.
library;

import 'dart:async';
import 'dart:convert';
Expand Down
Loading