From 34d150c4b2c39796530085505d471b8b0ee5c242 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 5 Dec 2023 09:59:39 -0800 Subject: [PATCH] Update latest lints and cleanup (#142) --- analysis_options.yaml | 5 ----- build_cli/lib/src/to_share.dart | 2 +- build_cli/pubspec.yaml | 2 +- build_cli/test/command_runner_integration_test.dart | 3 ++- build_cli/test/peanut_integration_test.dart | 8 +++----- build_cli/test/pubviz_integration_test.dart | 10 ++++------ build_cli_annotations/pubspec.yaml | 2 +- 7 files changed, 12 insertions(+), 20 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 38a59da..5f42a05 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -28,7 +28,6 @@ linter: - cancel_subscriptions - cascade_invocations - close_sinks - - comment_references - join_return_with_assignment - literal_only_boolean_expressions - missing_whitespace_between_adjacent_strings @@ -36,7 +35,6 @@ linter: - no_runtimeType_toString - one_member_abstracts - package_api_docs - - prefer_const_constructors - prefer_const_constructors_in_immutables - prefer_const_declarations - prefer_const_literals_to_create_immutables @@ -45,12 +43,9 @@ linter: - prefer_foreach - prefer_int_literals - prefer_mixin - - prefer_relative_imports - require_trailing_commas - - test_types_in_equals - unnecessary_await_in_return - unnecessary_breaks - use_setters_to_change_properties - use_string_buffers - - use_super_parameters - use_to_and_as_if_applicable diff --git a/build_cli/lib/src/to_share.dart b/build_cli/lib/src/to_share.dart index f5ce45b..3af2bd9 100644 --- a/build_cli/lib/src/to_share.dart +++ b/build_cli/lib/src/to_share.dart @@ -9,7 +9,7 @@ import 'package:analyzer/src/dart/element/inheritance_manager3.dart' show InheritanceManager3; import 'package:source_gen/source_gen.dart'; -Never throwBugFound(FieldElement element) => throwUnsupported( +Never throwBugFound(FieldElement element) => throwUnsupported( element, "You've hit a bug in build_cli!", todo: 'Please rerun your build with --verbose and file as issue ' diff --git a/build_cli/pubspec.yaml b/build_cli/pubspec.yaml index 2254f6f..7308bbc 100644 --- a/build_cli/pubspec.yaml +++ b/build_cli/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: args: ^2.0.0 build_runner: ^2.0.0 build_verify: ^3.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 io: ^1.0.0 path: ^1.0.0 source_gen_test: ^1.0.0 diff --git a/build_cli/test/command_runner_integration_test.dart b/build_cli/test/command_runner_integration_test.dart index e233e92..5a83211 100644 --- a/build_cli/test/command_runner_integration_test.dart +++ b/build_cli/test/command_runner_integration_test.dart @@ -5,7 +5,8 @@ import 'src/command_runner_example.dart'; void main() { test('use with CommandRunner', () async { - final runner = CommandRunner('my_app', '')..addCommand(CommitCommand()); + final runner = CommandRunner('my_app', '') + ..addCommand(CommitCommand()); await runner.run(['commit', '--all']); expect(CommitCommand.debugOptionsWhenRun?.all, isTrue); }); diff --git a/build_cli/test/peanut_integration_test.dart b/build_cli/test/peanut_integration_test.dart index e613c90..4018bc8 100644 --- a/build_cli/test/peanut_integration_test.dart +++ b/build_cli/test/peanut_integration_test.dart @@ -69,11 +69,9 @@ void main() { test('`${item.value.join(' ')}`', () { expect( () => parsePeanutOptions(item.value), - throwsA((error) { - expect(error, isFormatException); - expect((error as FormatException).message, item.key); - return true; - }), + throwsA( + isFormatException.having((e) => e.message, 'message', item.key), + ), ); }); } diff --git a/build_cli/test/pubviz_integration_test.dart b/build_cli/test/pubviz_integration_test.dart index 3d20b16..8ec2477 100644 --- a/build_cli/test/pubviz_integration_test.dart +++ b/build_cli/test/pubviz_integration_test.dart @@ -7,7 +7,7 @@ void main() { final options = parsePubvizOptions([]); expect(options.secret, isNull); - expect(options.ignorePackages, []); + expect(options.ignorePackages, []); expect(options.productionPort, 8080); expect(options.numValue, 3.14); expect(options.doubleValue, 3000.0); @@ -40,11 +40,9 @@ void main() { test('`${item.value.join(' ')}`', () { expect( () => parsePubvizOptions(item.value), - throwsA((error) { - expect(error, isFormatException); - expect((error as FormatException).message, item.key); - return true; - }), + throwsA( + isFormatException.having((e) => e.message, 'message', item.key), + ), ); }); } diff --git a/build_cli_annotations/pubspec.yaml b/build_cli_annotations/pubspec.yaml index 962a2e6..1baadee 100644 --- a/build_cli_annotations/pubspec.yaml +++ b/build_cli_annotations/pubspec.yaml @@ -12,5 +12,5 @@ environment: dependencies: # Limit version range on args – it's exported args: '>=2.0.0 <3.0.0' - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 meta: ^1.7.0