Skip to content

Commit

Permalink
Fix SdkInitializerContext when calling dart format
Browse files Browse the repository at this point in the history
Now includes the package, when explicitly called for a package
  • Loading branch information
passsy committed Jul 22, 2024
1 parent ea519a9 commit eb1c969
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sidekick_core/lib/src/commands/format_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class FormatCommand extends Command {
lineLength: lineLength,
files: allDartFiles,
verify: verify,
workingDirectory: package.root,
);
_verifyThrow();
return;
Expand Down Expand Up @@ -159,6 +160,7 @@ class FormatCommand extends Command {
required int lineLength,
required Iterable<File> files,
bool verify = false,
Directory? workingDirectory,
}) async {
if (verify) {
print("Verifying $name");
Expand All @@ -177,14 +179,15 @@ class FormatCommand extends Command {
'-l',
'$lineLength',
if (!verify) '--fix',
...files.map((file) => file.path),
...files.map((file) => file.absolute.path),
if (verify) '--set-exit-if-changed',
if (verify) '--output=none',
],
nothrow: verify,
// Lines like `Changed x.dart`, `Formatted x files (y changed) in z seconds`
// should only be printed when the change is actually written to the files (when verify is false)
progress: progress,
workingDirectory: workingDirectory,
);
exitCode = completion.exitCode ?? 1;
if (exitCode != 0) {
Expand Down

0 comments on commit eb1c969

Please sign in to comment.