From 6cd3e870ac170239096d97e7f25e18dedfb77f2c Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Sat, 2 Sep 2023 22:46:58 +0200 Subject: [PATCH] feat(neon,neon_notes,neon_lints): enable stricter rules Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/settings/models/storage.dart | 2 ++ packages/neon/neon/lib/src/utils/global.dart | 2 ++ packages/neon/neon/lib/src/utils/push_utils.dart | 2 ++ packages/neon/neon_notes/lib/utils/category_color.dart | 2 ++ packages/neon_lints/lib/dart.yaml | 4 ++-- packages/neon_lints/lint_maker.yaml | 2 -- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/neon/neon/lib/src/settings/models/storage.dart b/packages/neon/neon/lib/src/settings/models/storage.dart index 409ea3ff..3ce552af 100644 --- a/packages/neon/neon/lib/src/settings/models/storage.dart +++ b/packages/neon/neon/lib/src/settings/models/storage.dart @@ -38,6 +38,8 @@ enum StorageKeys implements Storable { @internal final class NeonStorage { + const NeonStorage._(); + /// Shared preferences instance. /// /// Use [database] to access it. diff --git a/packages/neon/neon/lib/src/utils/global.dart b/packages/neon/neon/lib/src/utils/global.dart index 8b8968b5..7fcef20d 100644 --- a/packages/neon/neon/lib/src/utils/global.dart +++ b/packages/neon/neon/lib/src/utils/global.dart @@ -3,6 +3,8 @@ import 'package:neon/src/models/push_notification.dart'; @internal class Global { + const Global._(); + static Function(String accountID)? onPushNotificationReceived; static Function(PushNotification notification)? onPushNotificationClicked; } diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index 35b7cd1a..6e91d933 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -21,6 +21,8 @@ import 'package:nextcloud/nextcloud.dart'; @internal @immutable class PushUtils { + const PushUtils._(); + static Future loadRSAKeypair() async { const storage = AppStorage(StorageKeys.notifications); const keyDevicePrivateKey = 'device-private-key'; diff --git a/packages/neon/neon_notes/lib/utils/category_color.dart b/packages/neon/neon_notes/lib/utils/category_color.dart index 1ce2dbb1..71a2dbb2 100644 --- a/packages/neon/neon_notes/lib/utils/category_color.dart +++ b/packages/neon/neon_notes/lib/utils/category_color.dart @@ -1,6 +1,8 @@ part of '../neon_notes.dart'; class NotesCategoryColor { + const NotesCategoryColor._(); + static final Map _colors = {}; static Color compute(final String category) { diff --git a/packages/neon_lints/lib/dart.yaml b/packages/neon_lints/lib/dart.yaml index 76b61b44..0aa65d92 100644 --- a/packages/neon_lints/lib/dart.yaml +++ b/packages/neon_lints/lib/dart.yaml @@ -18,8 +18,8 @@ linter: avoid_annotating_with_dynamic: false avoid_bool_literals_in_conditional_expressions: true avoid_catches_without_on_clauses: false - avoid_catching_errors: false - avoid_classes_with_only_static_members: false + avoid_catching_errors: true + avoid_classes_with_only_static_members: true avoid_double_and_int_checks: true avoid_dynamic_calls: true avoid_empty_else: true diff --git a/packages/neon_lints/lint_maker.yaml b/packages/neon_lints/lint_maker.yaml index bce60456..f613f348 100644 --- a/packages/neon_lints/lint_maker.yaml +++ b/packages/neon_lints/lint_maker.yaml @@ -6,8 +6,6 @@ dart: - avoid_annotating_with_dynamic - avoid_as - avoid_catches_without_on_clauses - - avoid_catching_errors - - avoid_classes_with_only_static_members - avoid_final_parameters - avoid_print - diagnostic_describe_all_properties