From: Shan Shaji <s.shaji@proxmox.com>
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 [thread overview]
Message-ID: <20260306143530.113174-2-s.shaji@proxmox.com> (raw)
In-Reply-To: <20260306143530.113174-1-s.shaji@proxmox.com>
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 <s.shaji@proxmox.com>
---
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<ProxmoxApiException>()
.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
next prev parent reply other threads:[~2026-03-06 14:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 14:35 [PATCH proxmox{_dart_api_client,_login_manager} 0/2] cleanup: replace deprecated property and fix dart analyze issues Shan Shaji
2026-03-06 14:35 ` Shan Shaji [this message]
2026-03-06 14:35 ` [PATCH proxmox_login_manager 1/1] cleanup: replace use of deprecated props " Shan Shaji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260306143530.113174-2-s.shaji@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox