Skip to content

Commit

Permalink
only format dart files (duh)
Browse files Browse the repository at this point in the history
  • Loading branch information
dickermoshe committed Oct 9, 2024
1 parent 31560f8 commit ba63ec6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drift_dev/lib/src/cli/commands/make_migrations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ class _MigrationTestEmitter {

/// Write all the files to the disk
void flush() {
for (final MapEntry(key: file, value: content) in writeTasks.entries) {
file.writeAsStringSync(DartFormatter().format(content));
for (var MapEntry(key: file, value: content) in writeTasks.entries) {
if (file.path.endsWith('.dart')) {
content = DartFormatter().format(content);
}
file.writeAsStringSync(content);
}
writeTasks.clear();
}
Expand Down Expand Up @@ -291,7 +294,7 @@ class _MigrationTestEmitter {
if (!schemaFile.existsSync()) {
cli.logger
.info('$dbName: Creating schema file for version $schemaVersion');
schemaFile.writeAsStringSync(DartFormatter().format(content));
schemaFile.writeAsStringSync(content);
// Re-parse the schema to include the newly created schema file
schemas = await parseSchema(schemaDir);
} else if (schemaFile.readAsStringSync() != content) {
Expand Down

0 comments on commit ba63ec6

Please sign in to comment.