From 046cc624242721f92290c6bcd692f66b57419260 Mon Sep 17 00:00:00 2001 From: Muhammad Essam Date: Thu, 14 Nov 2024 13:58:27 +0200 Subject: [PATCH 1/2] Downgrade http_parser dep to 4.0.2 --- pubspec.yaml | 2 +- test/disable_retry_test.dart | 2 ++ test/multipart_retry_tests.dart | 2 ++ test/override_retryable_statuses_test.dart | 2 ++ test/test_issue_2.dart | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index f1e55c8..25f7469 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ environment: dependencies: dio: ^5.7.0 - http_parser: ^4.1.0 + http_parser: ^4.0.2 path: ^1.9.0 dev_dependencies: diff --git a/test/disable_retry_test.dart b/test/disable_retry_test.dart index 7decf5f..22f0bf1 100644 --- a/test/disable_retry_test.dart +++ b/test/disable_retry_test.dart @@ -1,4 +1,6 @@ @TestOn('vm') +library; + import 'package:dio/dio.dart'; import 'package:dio_smart_retry/dio_smart_retry.dart'; import 'package:test/test.dart'; diff --git a/test/multipart_retry_tests.dart b/test/multipart_retry_tests.dart index 26b71da..b4e0466 100644 --- a/test/multipart_retry_tests.dart +++ b/test/multipart_retry_tests.dart @@ -1,4 +1,6 @@ @TestOn('vm') +library; + import 'package:dio/dio.dart'; import 'package:dio_smart_retry/dio_smart_retry.dart'; import 'package:test/test.dart'; diff --git a/test/override_retryable_statuses_test.dart b/test/override_retryable_statuses_test.dart index c35b620..26bfcca 100644 --- a/test/override_retryable_statuses_test.dart +++ b/test/override_retryable_statuses_test.dart @@ -1,4 +1,6 @@ @TestOn('vm') +library; + import 'package:dio/dio.dart'; import 'package:dio_smart_retry/dio_smart_retry.dart'; import 'package:test/test.dart'; diff --git a/test/test_issue_2.dart b/test/test_issue_2.dart index 6e7f2f6..5e30316 100644 --- a/test/test_issue_2.dart +++ b/test/test_issue_2.dart @@ -1,5 +1,7 @@ // https://github.com/rodion-m/dio_smart_retry/issues/2 @TestOn('vm') +library; + import 'package:dio/dio.dart'; import 'package:dio_smart_retry/dio_smart_retry.dart'; From 63b1d3d76f1db7b3015f96f6c01ca16b21e37da4 Mon Sep 17 00:00:00 2001 From: Muhammad Essam Date: Thu, 28 Nov 2024 15:55:41 +0200 Subject: [PATCH 2/2] Update DCM --- analysis_options.yaml | 7 ------- lib/src/default_retry_evaluator.dart | 1 - 2 files changed, 8 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 0ff3e80..04916cb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -3,13 +3,7 @@ linter: rules: public_member_api_docs: false -analyzer: - plugins: - - dart_code_metrics - dart_code_metrics: - anti-patterns: - - long-method metrics: cyclomatic-complexity: 20 maximum-nesting-level: 5 @@ -24,7 +18,6 @@ dart_code_metrics: - no-equal-arguments: severity: warning - avoid-unused-parameters - - binary-expression-operand-order - no-object-declaration - prefer-trailing-comma: exclude: diff --git a/lib/src/default_retry_evaluator.dart b/lib/src/default_retry_evaluator.dart index 0f39b91..dbb710c 100644 --- a/lib/src/default_retry_evaluator.dart +++ b/lib/src/default_retry_evaluator.dart @@ -10,7 +10,6 @@ class DefaultRetryEvaluator { /// Returns true only if the response hasn't been cancelled /// or got a bad status code. - // ignore: avoid-unused-parameters FutureOr evaluate(DioException error, int attempt) { bool shouldRetry; if (error.type == DioExceptionType.badResponse) {