From 69176561346482f0e0763fa4ecba610fd07dc16e Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 14 Nov 2023 00:37:53 +0000 Subject: [PATCH] [pkg] remove duplicate config from the analysis options files Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862 Reviewed-by: Nicholas Shahan Reviewed-by: Phil Quitslund Commit-Queue: Devon Carew --- pkg/_js_interop_checks/analysis_options.yaml | 5 +- pkg/analysis_server/analysis_options.yaml | 5 -- .../analysis_options.yaml | 18 +++---- pkg/analyzer/analysis_options.yaml | 4 -- pkg/analyzer_cli/analysis_options.yaml | 52 ++++++------------- pkg/analyzer_plugin/analysis_options.yaml | 41 ++++++--------- pkg/analyzer_utilities/analysis_options.yaml | 4 -- pkg/dart2native/analysis_options.yaml | 5 +- pkg/dartdev/analysis_options.yaml | 16 +++--- pkg/dds/analysis_options.yaml | 2 - pkg/dev_compiler/analysis_options.yaml | 1 - pkg/frontend_server/analysis_options.yaml | 13 +++-- pkg/js/analysis_options.yaml | 6 +-- pkg/js_ast/analysis_options.yaml | 1 - pkg/linter/analysis_options.yaml | 5 +- pkg/nnbd_migration/analysis_options.yaml | 10 ---- pkg/sourcemap_testing/analysis_options.yaml | 1 - pkg/test_runner/analysis_options.yaml | 1 - .../analysis_options.yaml | 6 +-- 19 files changed, 65 insertions(+), 131 deletions(-) diff --git a/pkg/_js_interop_checks/analysis_options.yaml b/pkg/_js_interop_checks/analysis_options.yaml index f18363961ff..0826ce21faf 100644 --- a/pkg/_js_interop_checks/analysis_options.yaml +++ b/pkg/_js_interop_checks/analysis_options.yaml @@ -2,6 +2,5 @@ include: package:lints/recommended.yaml linter: rules: - depend_on_referenced_packages: true - directives_ordering: true - sort_pub_dependencies: true + - directives_ordering + - sort_pub_dependencies diff --git a/pkg/analysis_server/analysis_options.yaml b/pkg/analysis_server/analysis_options.yaml index 9b43f5162c6..092df91c9a6 100644 --- a/pkg/analysis_server/analysis_options.yaml +++ b/pkg/analysis_server/analysis_options.yaml @@ -29,10 +29,6 @@ analyzer: linter: rules: - - collection_methods_unrelated_type - - dangling_library_doc_comments - - depend_on_referenced_packages - - implicit_call_tearoffs - library_annotations - prefer_single_quotes - unawaited_futures @@ -40,4 +36,3 @@ linter: - unnecessary_library_directive - unnecessary_parenthesis - unreachable_from_main - - use_super_parameters diff --git a/pkg/analysis_server_client/analysis_options.yaml b/pkg/analysis_server_client/analysis_options.yaml index fd44484a92b..dada431af9f 100644 --- a/pkg/analysis_server_client/analysis_options.yaml +++ b/pkg/analysis_server_client/analysis_options.yaml @@ -1,13 +1,13 @@ include: package:lints/recommended.yaml +analyzer: + errors: + constant_identifier_names: ignore + non_constant_identifier_names: ignore + linter: rules: - # In addition to lints/recommended: - always_declare_return_types: true - omit_local_variable_types: true - prefer_single_quotes: true - unawaited_futures: true - - # Remove from lints/recommended: - constant_identifier_names: false - non_constant_identifier_names: false + - always_declare_return_types + - omit_local_variable_types + - prefer_single_quotes + - unawaited_futures diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml index fe6dd162622..6b512c83623 100644 --- a/pkg/analyzer/analysis_options.yaml +++ b/pkg/analyzer/analysis_options.yaml @@ -40,12 +40,8 @@ linter: - always_use_package_imports - avoid_dynamic_calls - avoid_unused_constructor_parameters - - collection_methods_unrelated_type - - dangling_library_doc_comments - enable_null_safety - - implicit_call_tearoffs - library_annotations - unawaited_futures - unnecessary_library_directive - unnecessary_parenthesis - - use_super_parameters diff --git a/pkg/analyzer_cli/analysis_options.yaml b/pkg/analyzer_cli/analysis_options.yaml index 37d96684b76..8023bf1e774 100644 --- a/pkg/analyzer_cli/analysis_options.yaml +++ b/pkg/analyzer_cli/analysis_options.yaml @@ -4,44 +4,24 @@ analyzer: language: strict-casts: true strict-inference: true + errors: + # We import heavily from package:analyzer/src. + implementation_imports: ignore + non_constant_identifier_names: ignore exclude: - test/data/** linter: rules: - always_declare_return_types: true - avoid_empty_else: true - avoid_relative_lib_imports: true - avoid_shadowing_type_parameters: true - avoid_types_as_parameter_names: true - avoid_unused_constructor_parameters: true - camel_case_extensions: true - collection_methods_unrelated_type: true - curly_braces_in_flow_control_structures: true - - # Enable when we require Dart 2.19.0. - #- dangling_library_doc_comments - depend_on_referenced_packages: true - directives_ordering: true - empty_catches: true - enable_null_safety: true - flutter_style_todos: true - - # We import heavily from package:analyzer/src. - implementation_imports: false - implicit_call_tearoffs: true - library_annotations: true - - # This rule does not work well with package:test_reflective_loader. - no_duplicate_case_values: true - non_constant_identifier_names: false - omit_local_variable_types: true - prefer_is_empty: true - prefer_is_not_empty: true - prefer_iterable_whereType: true - prefer_single_quotes: true - unawaited_futures: true - unnecessary_library_directive: true - unnecessary_parenthesis: true - unreachable_from_main: true - unrelated_type_equality_checks: true + - always_declare_return_types + - avoid_unused_constructor_parameters + - directives_ordering + - enable_null_safety + - flutter_style_todos + - library_annotations + - omit_local_variable_types + - prefer_single_quotes + - unawaited_futures + - unnecessary_library_directive + - unnecessary_parenthesis + - unreachable_from_main diff --git a/pkg/analyzer_plugin/analysis_options.yaml b/pkg/analyzer_plugin/analysis_options.yaml index 527534093de..7ba7802f9b2 100644 --- a/pkg/analyzer_plugin/analysis_options.yaml +++ b/pkg/analyzer_plugin/analysis_options.yaml @@ -3,30 +3,23 @@ include: package:lints/recommended.yaml analyzer: language: strict-casts: true + errors: + # Remove from lints/recommended: + constant_identifier_names: ignore + implementation_imports: ignore + non_constant_identifier_names: ignore + # Existing violations (3) + library_private_types_in_public_api: ignore linter: rules: - # In addition to lints/recommended: - always_declare_return_types: true - collection_methods_unrelated_type: true - # Enable when we require Dart 2.19.0. - #dangling_library_doc_comments: true - depend_on_referenced_packages: true - enable_null_safety: true - flutter_style_todos: true - implicit_call_tearoffs: true - library_annotations: true - omit_local_variable_types: true - prefer_single_quotes: true - unawaited_futures: true - unnecessary_library_directive: true - unnecessary_parenthesis: true - unreachable_from_main: true - - # Remove from lints/recommended: - constant_identifier_names: false - implementation_imports: false - non_constant_identifier_names: false - - # Existing violations (3) - library_private_types_in_public_api: false \ No newline at end of file + - always_declare_return_types + - enable_null_safety + - flutter_style_todos + - library_annotations + - omit_local_variable_types + - prefer_single_quotes + - unawaited_futures + - unnecessary_library_directive + - unnecessary_parenthesis + - unreachable_from_main diff --git a/pkg/analyzer_utilities/analysis_options.yaml b/pkg/analyzer_utilities/analysis_options.yaml index 43955a11664..86c10cc2aa2 100644 --- a/pkg/analyzer_utilities/analysis_options.yaml +++ b/pkg/analyzer_utilities/analysis_options.yaml @@ -10,11 +10,7 @@ linter: rules: - avoid_dynamic_calls - avoid_unused_constructor_parameters - - collection_methods_unrelated_type - - dangling_library_doc_comments - - depend_on_referenced_packages - flutter_style_todos - - implicit_call_tearoffs - library_annotations - prefer_single_quotes - unawaited_futures diff --git a/pkg/dart2native/analysis_options.yaml b/pkg/dart2native/analysis_options.yaml index dd90435f987..814e6242148 100644 --- a/pkg/dart2native/analysis_options.yaml +++ b/pkg/dart2native/analysis_options.yaml @@ -3,6 +3,5 @@ include: package:lints/recommended.yaml linter: rules: # Enable additional rules. - depend_on_referenced_packages: true - directives_ordering: true - sort_pub_dependencies: true + - directives_ordering + - sort_pub_dependencies diff --git a/pkg/dartdev/analysis_options.yaml b/pkg/dartdev/analysis_options.yaml index 094baf6edf6..225c181425b 100644 --- a/pkg/dartdev/analysis_options.yaml +++ b/pkg/dartdev/analysis_options.yaml @@ -1,12 +1,12 @@ include: package:lints/recommended.yaml +analyzer: + errors: + # Disable implementation_imports. + implementation_imports: ignore + linter: rules: - # Disable implementation_imports. - implementation_imports: false - - # Enable additional rules. - depend_on_referenced_packages: true - directives_ordering: true - prefer_single_quotes: true - sort_pub_dependencies: true + - directives_ordering + - prefer_single_quotes + - sort_pub_dependencies diff --git a/pkg/dds/analysis_options.yaml b/pkg/dds/analysis_options.yaml index deffe109e91..7386f12d2e5 100644 --- a/pkg/dds/analysis_options.yaml +++ b/pkg/dds/analysis_options.yaml @@ -2,7 +2,5 @@ include: package:lints/recommended.yaml linter: rules: - - depend_on_referenced_packages - directives_ordering - - prefer_generic_function_type_aliases - prefer_relative_imports diff --git a/pkg/dev_compiler/analysis_options.yaml b/pkg/dev_compiler/analysis_options.yaml index 177fdbbf1bc..7cb5d19a0ec 100644 --- a/pkg/dev_compiler/analysis_options.yaml +++ b/pkg/dev_compiler/analysis_options.yaml @@ -23,7 +23,6 @@ linter: rules: # Not enforced by lints at any version. - always_declare_return_types - - depend_on_referenced_packages - directives_ordering - omit_local_variable_types - prefer_single_quotes diff --git a/pkg/frontend_server/analysis_options.yaml b/pkg/frontend_server/analysis_options.yaml index 7604d52c7fb..9062ca559a1 100644 --- a/pkg/frontend_server/analysis_options.yaml +++ b/pkg/frontend_server/analysis_options.yaml @@ -1,12 +1,11 @@ include: package:lints/recommended.yaml -linter: - rules: - - depend_on_referenced_packages - - directives_ordering - - sort_pub_dependencies - - unawaited_futures - analyzer: exclude: - test/fixtures/** + +linter: + rules: + - directives_ordering + - sort_pub_dependencies + - unawaited_futures diff --git a/pkg/js/analysis_options.yaml b/pkg/js/analysis_options.yaml index ea5b6fdfded..1ca5960a4cb 100644 --- a/pkg/js/analysis_options.yaml +++ b/pkg/js/analysis_options.yaml @@ -3,8 +3,6 @@ include: package:lints/recommended.yaml analyzer: language: strict-casts: true - -linter: - rules: + errors: # Ignore this lint (triggered by the annotation definitions in lib/js.dart). - library_private_types_in_public_api: false + library_private_types_in_public_api: ignore diff --git a/pkg/js_ast/analysis_options.yaml b/pkg/js_ast/analysis_options.yaml index 6772cd58f11..734eee2e75a 100644 --- a/pkg/js_ast/analysis_options.yaml +++ b/pkg/js_ast/analysis_options.yaml @@ -20,7 +20,6 @@ linter: # Not enforced by the lints package at any version. - always_declare_return_types - avoid_dynamic_calls - - depend_on_referenced_packages - directives_ordering - prefer_single_quotes - prefer_relative_imports diff --git a/pkg/linter/analysis_options.yaml b/pkg/linter/analysis_options.yaml index 96a6aff2598..6e22b42e0ee 100644 --- a/pkg/linter/analysis_options.yaml +++ b/pkg/linter/analysis_options.yaml @@ -9,6 +9,7 @@ analyzer: - test_data/** language: strict-casts: true + linter: rules: - always_put_required_named_parameters_first @@ -27,13 +28,10 @@ linter: - avoid_unused_constructor_parameters - cancel_subscriptions - cast_nullable_to_non_nullable - - collection_methods_unrelated_type - comment_references - - dangling_library_doc_comments - directives_ordering - discarded_futures - flutter_style_todos - - implicit_call_tearoffs - join_return_with_assignment - library_annotations - literal_only_boolean_expressions @@ -66,5 +64,4 @@ linter: - use_late_for_private_fields_and_variables - use_setters_to_change_properties - use_string_buffers - - use_super_parameters - use_to_and_as_if_applicable diff --git a/pkg/nnbd_migration/analysis_options.yaml b/pkg/nnbd_migration/analysis_options.yaml index 09eece3a784..0032b11ad34 100644 --- a/pkg/nnbd_migration/analysis_options.yaml +++ b/pkg/nnbd_migration/analysis_options.yaml @@ -23,19 +23,9 @@ analyzer: linter: rules: - - await_only_futures - - collection_methods_unrelated_type - - dangling_library_doc_comments - - depend_on_referenced_packages - - empty_constructor_bodies - - empty_statements - enable_null_safety - - implicit_call_tearoffs - library_annotations - unawaited_futures - - unnecessary_brace_in_string_interps - unnecessary_library_directive - unnecessary_parenthesis - unreachable_from_main - - use_super_parameters - - valid_regexps diff --git a/pkg/sourcemap_testing/analysis_options.yaml b/pkg/sourcemap_testing/analysis_options.yaml index a7b9b011c90..51e543718e6 100644 --- a/pkg/sourcemap_testing/analysis_options.yaml +++ b/pkg/sourcemap_testing/analysis_options.yaml @@ -12,7 +12,6 @@ linter: rules: # Not enforced by the lints package at any version. - always_declare_return_types - - depend_on_referenced_packages - directives_ordering - prefer_single_quotes - prefer_relative_imports diff --git a/pkg/test_runner/analysis_options.yaml b/pkg/test_runner/analysis_options.yaml index b2e693b5631..2d96f815fde 100644 --- a/pkg/test_runner/analysis_options.yaml +++ b/pkg/test_runner/analysis_options.yaml @@ -21,4 +21,3 @@ linter: - unnecessary_lambdas - unnecessary_parenthesis - unnecessary_statements - - unnecessary_string_escapes diff --git a/pkg/vm_snapshot_analysis/analysis_options.yaml b/pkg/vm_snapshot_analysis/analysis_options.yaml index cdcc0222e82..5bf2fecc1f0 100644 --- a/pkg/vm_snapshot_analysis/analysis_options.yaml +++ b/pkg/vm_snapshot_analysis/analysis_options.yaml @@ -6,7 +6,5 @@ analyzer: linter: rules: - # Enable additional rules. - depend_on_referenced_packages: true - directives_ordering: true - sort_pub_dependencies: true + - directives_ordering + - sort_pub_dependencies