From 6f87a878ab0341ebdc6e97f44aaa331dcc8726d5 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Wed, 16 Oct 2024 18:04:31 +0000 Subject: [PATCH 1/2] Migrates to workiva_analysis_options v2 --- analysis_options.yaml | 58 +------------------------------------------ pubspec.yaml | 1 + 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 0fbb436..cd6b6cb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,60 +1,4 @@ +include: package:workiva_analysis_options/v2.yaml analyzer: exclude: - example/** -linter: - rules: - # Error Rules - - avoid_empty_else - - cancel_subscriptions - - close_sinks - - comment_references - - control_flow_in_finally - - empty_statements - - hash_and_equals - - invariant_booleans - - iterable_contains_unrelated_type - - list_remove_unrelated_type - - literal_only_boolean_expressions - - test_types_in_equals - - throw_in_finally - - unrelated_type_equality_checks - - valid_regexps - - # Style Rules - - always_declare_return_types - - annotate_overrides - - avoid_as - - avoid_init_to_null - - avoid_return_types_on_setters - - await_only_futures - - camel_case_types - - constant_identifier_names - - empty_catches - - empty_constructor_bodies - - implementation_imports - - library_names - - library_prefixes - - non_constant_identifier_names - - one_member_abstracts - - only_throw_errors - - overridden_fields - - package_api_docs - - package_prefixed_library_names - - prefer_is_not_empty - - slash_for_doc_comments - - sort_constructors_first - - sort_unnamed_constructors_first - - type_annotate_public_apis - - type_init_formals - - unawaited_futures - - unnecessary_brace_in_string_interps - - unnecessary_getters_setters - - # TODO - #- public_member_api_docs - - # This rule forces overly verbose declaration of variables. - #- always_specify_types - - # Pub Rules - - package_names diff --git a/pubspec.yaml b/pubspec.yaml index 36dba6d..7fd429f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,6 +22,7 @@ dev_dependencies: matcher: ^0.12.10 mocktail: ^1.0.3 test: ^1.16.8 + workiva_analysis_options: ^1.4.1 dependency_validator: exclude: From 61a43ee18cd228a013bb0cd8298be9e4af648f6e Mon Sep 17 00:00:00 2001 From: Dustin Pauze Date: Thu, 17 Oct 2024 05:57:07 -0400 Subject: [PATCH 2/2] FEDX-1707: code cleanup --- lib/src/lifecycle_module.dart | 8 +------- test/event_test.dart | 4 ---- test/utils.dart | 3 --- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/src/lifecycle_module.dart b/lib/src/lifecycle_module.dart index 97a7464..c7f932f 100644 --- a/lib/src/lifecycle_module.dart +++ b/lib/src/lifecycle_module.dart @@ -17,7 +17,7 @@ library w_module.src.lifecycle_module; import 'dart:async'; import 'package:logging/logging.dart'; -import 'package:meta/meta.dart' show mustCallSuper, protected, required; +import 'package:meta/meta.dart' show mustCallSuper, protected; import 'package:opentracing/opentracing.dart'; import 'package:w_common/disposable.dart'; @@ -178,9 +178,6 @@ abstract class LifecycleModule extends SimpleModule with Disposable { } final tracer = globalTracer(); - if (tracer == null) { - return null; - } List references = []; if (_parentContext != null) { @@ -230,9 +227,6 @@ abstract class LifecycleModule extends SimpleModule with Disposable { } final tracer = globalTracer(); - if (tracer == null) { - return null; - } tracer .startSpan( diff --git a/test/event_test.dart b/test/event_test.dart index 1215feb..fbabb6c 100644 --- a/test/event_test.dart +++ b/test/event_test.dart @@ -28,10 +28,6 @@ void main() { event = Event(key); }); - test('should inherit from Stream', () { - expect(event is Stream, isTrue); - }); - test('should provide means to listen to the stream it was created from', () async { Completer completer = Completer(); diff --git a/test/utils.dart b/test/utils.dart index 7cc9c30..ce611c0 100644 --- a/test/utils.dart +++ b/test/utils.dart @@ -30,9 +30,6 @@ class _LogLevelMatcher extends Matcher { @override bool matches(dynamic record, Map matchState) { - if (_level == null) { - return false; - } if (record is LogRecord) { return record.level == _level; }