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-1710: Workiva Analysis Options v2 #93

Merged
merged 3 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
60 changes: 1 addition & 59 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1 @@
linter:
rules:
# - always_declare_return_types
# - annotate_overrides
# - avoid_empty_else
# - avoid_init_to_null
# - avoid_return_types_on_setters
# - await_only_futures
# - camel_case_types
- cancel_subscriptions
- close_sinks
# - comment_references
# - constant_identifier_names
# - control_flow_in_finally
# - empty_catches
# - empty_constructor_bodies
# - empty_statements
# - hash_and_equals
# - invariant_booleans
# - iterable_contains_unrelated_type
# - library_names
# - library_prefixes
# - list_remove_unrelated_type
# - literal_only_boolean_expressions
# - only_throw_errors
# - overridden_fields
# - package_api_docs
# - package_names
# - package_prefixed_library_names
# - parameter_assignments
# - prefer_final_fields
# - prefer_final_locals
# - prefer_is_not_empty
# - public_member_api_docs
# - slash_for_doc_comments
# - sort_constructors_first
# - sort_unnamed_constructors_first
# - test_types_in_equals
# - throw_in_finally
# - type_annotate_public_apis
# - type_init_formals
# - unawaited_futures
# - unnecessary_brace_in_string_interps
# - unnecessary_getters_setters
# - unrelated_type_equality_checks
# - valid_regexps

# This rule forces overly verbose declaration of variables.
#- always_specify_type

# This rule isn't currently enabled becaus there are valid uses for using 'as', such as
# verifying that an object is a specific mixin.
# - avoid_as

# These rules were found to be unenforceable as they would require breaking changes or
# were too noisy.
# - implementation_imports
# - non_constant_identifier_names
# - one_member_abstracts
include: package:workiva_analysis_options/v2.yaml
5 changes: 3 additions & 2 deletions lib/src/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import 'package:state_machine/src/state_machine.dart';
/// that has already been started.
class IllegalStateMachineMutation implements Exception {
String message;
IllegalStateMachineMutation(String this.message);
IllegalStateMachineMutation(this.message);
@override
String toString() => 'IllegalStateMachineMutation: $message';
}

Expand All @@ -33,7 +34,7 @@ class IllegalStateTransition implements Exception {
State from;
State to;
StateTransition transition;
IllegalStateTransition(StateTransition this.transition, this.from, this.to);
IllegalStateTransition(this.transition, this.from, this.to);
String get message =>
'("${transition.name}") cannot transition from "${from.name}" to "${to.name}".';
@override
Expand Down
5 changes: 2 additions & 3 deletions lib/src/state_machine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class StateMachine extends Disposable {
/// List of states created by for this machine.
List<State> _states = [];

StateMachine(String this.name) {
StateMachine(this.name) {
manageStreamController(_stateChangeController);
_stateChangeStream = _stateChangeController.stream.asBroadcastStream();
manageDisposable(_current);
Expand Down Expand Up @@ -426,8 +426,7 @@ class StateTransition extends Disposable {
/// this transition.
State _to;

StateTransition._(String this.name, StateMachine this._machine,
List<State> this._from, State this._to) {
StateTransition._(this.name, this._machine, this._from, this._to) {
if (_to == State.any)
throw ArgumentError(
'Cannot transition to the wildcard state "State.any"');
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ dev_dependencies:
build_web_compilers: ^3.0.0
dart_style: ^2.1.1
test: ^1.17.12
workiva_analysis_options: ^1.4.2
Loading