mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
style: reformat codebase using melos format
Applied consistent code formatting across all packages using \$ melos format
└> dart format .
└> RUNNING (in 8 packages)
--------------------------------------------------------------------------------
benchmark_di:
Formatted 18 files (0 changed) in 0.30 seconds.
benchmark_di: SUCCESS
--------------------------------------------------------------------------------
cherrypick:
Formatted 24 files (0 changed) in 0.34 seconds.
cherrypick: SUCCESS
--------------------------------------------------------------------------------
cherrypick_annotations:
Formatted 11 files (0 changed) in 0.14 seconds.
cherrypick_annotations: SUCCESS
--------------------------------------------------------------------------------
cherrypick_flutter:
Formatted 3 files (0 changed) in 0.15 seconds.
cherrypick_flutter: SUCCESS
--------------------------------------------------------------------------------
cherrypick_generator:
Formatted 17 files (0 changed) in 0.27 seconds.
cherrypick_generator: SUCCESS
--------------------------------------------------------------------------------
client_app:
Formatted 4 files (0 changed) in 0.14 seconds.
client_app: SUCCESS
--------------------------------------------------------------------------------
postly:
Formatted lib/router/app_router.gr.dart
Formatted 23 files (1 changed) in 0.33 seconds.
postly: SUCCESS
--------------------------------------------------------------------------------
talker_cherrypick_logger:
Formatted 4 files (0 changed) in 0.18 seconds.
talker_cherrypick_logger: SUCCESS
--------------------------------------------------------------------------------
$ melos format
└> dart format .
└> SUCCESS. No functional or logic changes included.
This commit is contained in:
@@ -69,26 +69,32 @@ class TalkerCherryPickObserver implements CherryPickObserver {
|
||||
|
||||
/// Called when a new instance is created.
|
||||
@override
|
||||
void onInstanceCreated(String name, Type type, Object instance, {String? scopeName}) {
|
||||
talker.info('[create][CherryPick] $name — $type => $instance (scope: $scopeName)');
|
||||
void onInstanceCreated(String name, Type type, Object instance,
|
||||
{String? scopeName}) {
|
||||
talker.info(
|
||||
'[create][CherryPick] $name — $type => $instance (scope: $scopeName)');
|
||||
}
|
||||
|
||||
/// Called when an instance is disposed.
|
||||
@override
|
||||
void onInstanceDisposed(String name, Type type, Object instance, {String? scopeName}) {
|
||||
talker.info('[dispose][CherryPick] $name — $type => $instance (scope: $scopeName)');
|
||||
void onInstanceDisposed(String name, Type type, Object instance,
|
||||
{String? scopeName}) {
|
||||
talker.info(
|
||||
'[dispose][CherryPick] $name — $type => $instance (scope: $scopeName)');
|
||||
}
|
||||
|
||||
/// Called when modules are installed.
|
||||
@override
|
||||
void onModulesInstalled(List<String> modules, {String? scopeName}) {
|
||||
talker.info('[modules installed][CherryPick] ${modules.join(', ')} (scope: $scopeName)');
|
||||
talker.info(
|
||||
'[modules installed][CherryPick] ${modules.join(', ')} (scope: $scopeName)');
|
||||
}
|
||||
|
||||
/// Called when modules are removed.
|
||||
@override
|
||||
void onModulesRemoved(List<String> modules, {String? scopeName}) {
|
||||
talker.info('[modules removed][CherryPick] ${modules.join(', ')} (scope: $scopeName)');
|
||||
talker.info(
|
||||
'[modules removed][CherryPick] ${modules.join(', ')} (scope: $scopeName)');
|
||||
}
|
||||
|
||||
/// Called when a DI scope is opened.
|
||||
@@ -106,7 +112,8 @@ class TalkerCherryPickObserver implements CherryPickObserver {
|
||||
/// Called if the DI container detects a cycle in the dependency graph.
|
||||
@override
|
||||
void onCycleDetected(List<String> chain, {String? scopeName}) {
|
||||
talker.warning('[cycle][CherryPick] Detected: ${chain.join(' -> ')}${scopeName != null ? ' (scope: $scopeName)' : ''}');
|
||||
talker.warning(
|
||||
'[cycle][CherryPick] Detected: ${chain.join(' -> ')}${scopeName != null ? ' (scope: $scopeName)' : ''}');
|
||||
}
|
||||
|
||||
/// Called when an instance is found in the cache.
|
||||
@@ -136,6 +143,7 @@ class TalkerCherryPickObserver implements CherryPickObserver {
|
||||
/// Called for error events with optional stack trace.
|
||||
@override
|
||||
void onError(String message, Object? error, StackTrace? stackTrace) {
|
||||
talker.handle(error ?? '[CherryPick] $message', stackTrace, '[error][CherryPick] $message');
|
||||
talker.handle(error ?? '[CherryPick] $message', stackTrace,
|
||||
'[error][CherryPick] $message');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ void main() {
|
||||
test('onInstanceRequested logs info', () {
|
||||
observer.onInstanceRequested('A', String, scopeName: 'test');
|
||||
final log = talker.history.last;
|
||||
expect(log.message, contains('[request][CherryPick] A — String (scope: test)'));
|
||||
expect(log.message,
|
||||
contains('[request][CherryPick] A — String (scope: test)'));
|
||||
});
|
||||
|
||||
test('onCycleDetected logs warning', () {
|
||||
|
||||
Reference in New Issue
Block a user