From 0455c323682a8de6545a486b1eea157dd45af9f6 Mon Sep 17 00:00:00 2001 From: lsaudon Date: Tue, 15 Oct 2024 22:00:39 +0200 Subject: [PATCH] chore: update dependencies and linter rules --- analysis_options.yaml | 8 ++++++++ lib/pubspec_version_cli.dart | 11 +--------- lib/src/command_runner.dart | 2 +- pubspec.yaml | 24 +++++++++++----------- test/src/command_runner_test.dart | 4 ++-- test/src/commands/update_command_test.dart | 4 ++-- 6 files changed, 26 insertions(+), 27 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 46a1fff..ec045cb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -16,6 +16,7 @@ linter: # - always_specify_types - always_use_package_imports - annotate_overrides + - annotate_redeclares - avoid_annotating_with_dynamic - avoid_bool_literals_in_conditional_expressions - avoid_catches_without_on_clauses @@ -76,6 +77,7 @@ linter: - directives_ordering # - discarded_futures - do_not_use_environment + - document_ignores - empty_catches - empty_constructor_bodies - empty_statements @@ -88,6 +90,7 @@ linter: - implicit_call_tearoffs - implicit_reopen - invalid_case_patterns + - invalid_runtime_check_with_js_interop_types - join_return_with_assignment - leading_newlines_in_multiline_strings - library_annotations @@ -97,6 +100,7 @@ linter: - lines_longer_than_80_chars - literal_only_boolean_expressions - matching_super_parameters + - missing_code_block_language_in_doc_comment - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_default_cases @@ -106,6 +110,8 @@ linter: - no_literal_bool_comparisons - no_logic_in_create_state - no_runtimeType_toString + - no_self_assignments + - no_wildcard_variable_uses - non_constant_identifier_names - noop_primitive_operations - null_check_on_nullable_type_parameter @@ -176,6 +182,7 @@ linter: - type_init_formals - type_literal_in_constant_pattern - unawaited_futures + - unintended_html_in_doc_comment - unnecessary_await_in_return - unnecessary_brace_in_string_interps - unnecessary_breaks @@ -186,6 +193,7 @@ linter: - unnecessary_lambdas - unnecessary_late - unnecessary_library_directive + - unnecessary_library_name - unnecessary_new - unnecessary_null_aware_assignments - unnecessary_null_aware_operator_on_extension_on_nullable diff --git a/lib/pubspec_version_cli.dart b/lib/pubspec_version_cli.dart index a7bbe61..8b13789 100644 --- a/lib/pubspec_version_cli.dart +++ b/lib/pubspec_version_cli.dart @@ -1,10 +1 @@ -/// pubspec_version_cli, Command-Line Interface to change the version in pubspec -/// -/// ```sh -/// # activate pubspec_version_cli -/// dart pub global activate pubspec_version_cli -/// -/// # see usage -/// pubspec_version --help -/// ``` -library pubspec_version_cli; + diff --git a/lib/src/command_runner.dart b/lib/src/command_runner.dart index b34d601..b4886a2 100644 --- a/lib/src/command_runner.dart +++ b/lib/src/command_runner.dart @@ -20,7 +20,7 @@ const description = 'Command-Line Interface to change the version in pubspec'; /// {@template pubspec_version_cli_command_runner} /// A [CommandRunner] for the CLI. /// -/// ``` +/// ```bash /// $ pubspec_version --version /// ``` /// {@endtemplate} diff --git a/pubspec.yaml b/pubspec.yaml index 1328572..2bc2d0d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,20 +9,20 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - args: ^2.4.2 - cli_completion: ">=0.4.0 <0.6.0" - file: ^7.0.0 - mason_logger: ">=0.2.10 <0.4.0" - path: ^1.8.3 - pub_updater: ">=0.4.0 <0.6.0" - yaml: ^3.1.2 + args: 2.6.0 + cli_completion: 0.5.1 + file: 7.0.1 + mason_logger: 0.3.1 + path: 1.9.0 + pub_updater: 0.5.0 + yaml: 3.1.2 dev_dependencies: - build_runner: ^2.4.6 - build_verify: ^3.1.0 - build_version: ^2.1.1 - mocktail: ^1.0.1 - test: ^1.24.7 + build_runner: 2.4.13 + build_verify: 3.1.0 + build_version: 2.1.1 + mocktail: 1.0.4 + test: 1.25.8 executables: pubspec_version: diff --git a/test/src/command_runner_test.dart b/test/src/command_runner_test.dart index 08c3ca3..ee9f22f 100644 --- a/test/src/command_runner_test.dart +++ b/test/src/command_runner_test.dart @@ -85,8 +85,8 @@ void main() { final progress = _MockProgress(); final progressLogs = []; - when(() => progress.complete(any())).thenAnswer((final _) { - final message = _.positionalArguments.elementAt(0) as String?; + when(() => progress.complete(any())).thenAnswer((final invocation) { + final message = invocation.positionalArguments.elementAt(0) as String?; if (message != null) { progressLogs.add(message); } diff --git a/test/src/commands/update_command_test.dart b/test/src/commands/update_command_test.dart index 0b5b82c..ab6fd01 100644 --- a/test/src/commands/update_command_test.dart +++ b/test/src/commands/update_command_test.dart @@ -47,8 +47,8 @@ void main() { currentVersion: any(named: 'currentVersion'), ), ).thenAnswer((final _) async => true); - when(() => progress.complete(any())).thenAnswer((final _) { - final message = _.positionalArguments.elementAt(0) as String?; + when(() => progress.complete(any())).thenAnswer((final invocation) { + final message = invocation.positionalArguments.elementAt(0) as String?; if (message != null) { progressLogs.add(message); }