From f278f97791f8aa788c1b50e5bbbceda0ca6231b7 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Wed, 18 Mar 2026 23:40:44 +1100 Subject: [PATCH 1/2] Fix the error message issue --- bin/fix_imports.dart | 14 ++++++++++---- bin/import_order.dart | 8 +++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bin/fix_imports.dart b/bin/fix_imports.dart index 98ef60b..14d10c3 100644 --- a/bin/fix_imports.dart +++ b/bin/fix_imports.dart @@ -91,9 +91,15 @@ void main(List args) { final bool verbose = argResults['verbose'] as bool; final bool recursive = argResults['recursive'] as bool; - final bool checkMode = argResults['check'] as bool || - argResults['dry-run'] as bool || - argResults['set-exit-if-changed'] as bool; + final bool isCheck = argResults['check'] as bool; + final bool isDryRun = argResults['dry-run'] as bool; + final bool isSetExitIfChanged = argResults['set-exit-if-changed'] as bool; + final bool checkMode = isCheck || isDryRun || isSetExitIfChanged; + final String checkFlag = isCheck + ? '--check' + : isDryRun + ? '--dry-run' + : '--set-exit-if-changed'; final String? explicitProjectName = argResults['project-name'] as String?; final List filePaths = argResults.rest; @@ -150,7 +156,7 @@ void main(List args) { print( '\nšŸ“ Summary: Found import ordering issues in ${errors.length} file(s).'); print( - 'šŸ’” To fix these issues, run the same command without --set-exit-if-changed'); + 'šŸ’” To fix these issues, run the same command without $checkFlag'); exit(1); } else { print( diff --git a/bin/import_order.dart b/bin/import_order.dart index e77228a..cfc9e6a 100644 --- a/bin/import_order.dart +++ b/bin/import_order.dart @@ -84,9 +84,11 @@ void main(List args) { final newArgs = []; if (argResults['verbose'] as bool) newArgs.add('--verbose'); - if (argResults['set-exit-if-changed'] as bool || - argResults['check'] as bool || - argResults['dry-run'] as bool) { + if (argResults['check'] as bool) { + newArgs.add('--check'); + } else if (argResults['dry-run'] as bool) { + newArgs.add('--dry-run'); + } else if (argResults['set-exit-if-changed'] as bool) { newArgs.add('--set-exit-if-changed'); } if (projectName.isNotEmpty) { From df5dd931c996ee24e6eaa0e5ef53cdcf53022ec0 Mon Sep 17 00:00:00 2001 From: Tony Chen Date: Thu, 19 Mar 2026 00:17:19 +1100 Subject: [PATCH 2/2] Update the SDK version requirement in pubspec.yaml --- example/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e2bd3a5..22ea62b 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.0.0 <4.0.0' + sdk: '>=3.9.0 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions