Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEDX-1707: Workiva Analysis Options v2 #254

Merged
merged 2 commits into from
Oct 17, 2024
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
58 changes: 1 addition & 57 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,4 @@
include: package:workiva_analysis_options/v2.yaml
analyzer:
exclude:
- example/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a limitation of the batch that was ran, but can we try removing the specified linter rules below this line?

Ideally we just lean on workiva_analysis_options provides

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
8 changes: 1 addition & 7 deletions lib/src/lifecycle_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -178,9 +178,6 @@ abstract class LifecycleModule extends SimpleModule with Disposable {
}

final tracer = globalTracer();
if (tracer == null) {
return null;
}

List<Reference> references = [];
if (_parentContext != null) {
Expand Down Expand Up @@ -230,9 +227,6 @@ abstract class LifecycleModule extends SimpleModule with Disposable {
}

final tracer = globalTracer();
if (tracer == null) {
return null;
}

tracer
.startSpan(
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ void main() {
event = Event<String>(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();
Expand Down
3 changes: 0 additions & 3 deletions test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down