Skip to content

Commit

Permalink
fix constraints spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
dickermoshe committed Sep 19, 2024
1 parent 041f201 commit d7f6f62
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/custom_lint/lib/src/workspace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ publish_to: 'none'

final String constraint;
if (allDependencies.dependencyOverrides.isNotEmpty) {
constraint = 'any';
constraint = ' any';
} else {
constraint = _buildDependencyConstraint(
name,
Expand All @@ -714,18 +714,20 @@ publish_to: 'none'
}
}

void writeDependencyToBuffer(MapEntry<String, String> dependency) {
buffer.writeln(' ${dependency.key}:${dependency.value}');
}

// Write the dependencies to the buffer.
if (dependencyConstraints.dependencies.isNotEmpty) {
buffer.writeln('\ndependencies:');
for (final dependency in dependencyConstraints.dependencies.entries) {
buffer.writeln(' ${dependency.key}: ${dependency.value}');
}
dependencyConstraints.dependencies.entries
.forEach(writeDependencyToBuffer);
}
if (dependencyConstraints.devDependencies.isNotEmpty) {
buffer.writeln('\ndev_dependencies:');
for (final dependency in dependencyConstraints.devDependencies.entries) {
buffer.writeln(' ${dependency.key}: ${dependency.value}');
}
dependencyConstraints.devDependencies.entries
.forEach(writeDependencyToBuffer);
}

// Write the dependency_overrides to the buffer.
Expand Down

0 comments on commit d7f6f62

Please sign in to comment.