From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7A7C21FF13E for ; Fri, 06 Mar 2026 15:35:13 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 42D1B36572; Fri, 6 Mar 2026 15:36:20 +0100 (CET) From: Shan Shaji To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox_dart_api_client 1/1] fix: cleanup: dart analysis issues found by dart linter Date: Fri, 6 Mar 2026 15:35:29 +0100 Message-ID: <20260306143530.113174-2-s.shaji@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260306143530.113174-1-s.shaji@proxmox.com> References: <20260306143530.113174-1-s.shaji@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772807715802 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.114 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SHORT 0.001 Use of a URL Shortener for very short URL RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: Y6PJ75YVNHW2ONSOLCSBDALG4RNBSR3G X-Message-ID-Hash: Y6PJ75YVNHW2ONSOLCSBDALG4RNBSR3G X-MailFrom: s.shaji@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The library name is not necessary anymore [0]. Removed the same and updated the doc comments. Additionaly, added explicit types for variables as suggested by the dart linter (lints) [1][2]. [0] - https://dart.dev/tools/linter-rules/unnecessary_library_name [1] - https://dart.dev/tools/linter-rules/prefer_typing_uninitialized_variables [2] - https://dart.dev/tools/linter-rules/strict_top_level_inference Signed-off-by: Shan Shaji --- lib/proxmox_dart_api_client.dart | 6 ++---- lib/src/extentions.dart | 3 ++- test/test.dart | 10 ++++------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/proxmox_dart_api_client.dart b/lib/proxmox_dart_api_client.dart index 9eaa257..20d76dd 100644 --- a/lib/proxmox_dart_api_client.dart +++ b/lib/proxmox_dart_api_client.dart @@ -1,7 +1,5 @@ -/// Support for doing something awesome. -/// -/// More dartdocs go here. -library proxmox_dart_api_client; +/// Proxmox Dart API client. +library; export 'src/client.dart'; export 'src/authenticate.dart'; diff --git a/lib/src/extentions.dart b/lib/src/extentions.dart index 8b73683..2dd9352 100644 --- a/lib/src/extentions.dart +++ b/lib/src/extentions.dart @@ -10,7 +10,8 @@ extension ResponseValidation on http.Response { if (reasonPhrase != null) { message = '$statusCode: $reasonPhrase'; } - var decodedErrors; + + dynamic decodedErrors; if (extensive) { try { diff --git a/test/test.dart b/test/test.dart index 5261f7e..23368a2 100644 --- a/test/test.dart +++ b/test/test.dart @@ -3,7 +3,7 @@ import 'package:http/http.dart' as http; import 'package:proxmox_dart_api_client/src/handle_ticket_response.dart'; import 'package:test/test.dart'; -Matcher throwsProxmoxApiException(message, statusCode) => +Matcher throwsProxmoxApiException(String message, int statusCode) => throwsA(isA() .having((e) => e.message, 'message ', message) .having((e) => e.statusCode, 'http status code', statusCode)); @@ -20,16 +20,14 @@ void main() { test('fail >= 400', () { var response = http.Response('', 400); - expect( - () => response.validate(false), - throwsProxmoxApiException( - 'Request failed with status 400', equals(400))); + expect(() => response.validate(false), + throwsProxmoxApiException('Request failed with status 400', 400)); }); test('fail >= 400 with reason phrase', () { var response = http.Response('', 400, reasonPhrase: 'this did not work'); expect(() => response.validate(false), - throwsProxmoxApiException('400: this did not work', equals(400))); + throwsProxmoxApiException('400: this did not work', 400)); }); test('valid credentials extraction', () { -- 2.47.3