Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private static Yaml createYaml() {
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setPrettyFlow(false);
options.setIndent(2);
options.setIndicatorIndent(0);
options.setIndicatorIndent(2);
options.setIndentWithIndicator(true);
options.setWidth(120);
return new Yaml(new SafeConstructor(new LoaderOptions()), new Representer(options), options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ private static Yaml createYaml() {
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setPrettyFlow(true);
options.setIndent(2);
options.setIndicatorIndent(2);
options.setIndentWithIndicator(true);
options.setWidth(120);
return new Yaml(new SafeConstructor(new LoaderOptions()), new Representer(options), options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ void renamesAKeyAndMovesAValueIntoANestedSection() {
assertFalse(result.getContent().contains("legacy"));
}

@Test
void listItemsAreIndentedUnderTheirKey() {
YamlMigrationEngine.Result result = engine.migrate("old: 1\nhost: h\nlist: [a, b]\n", new Steps());

assertTrue(result.getContent().contains("list:\n - a\n - b"), result.getContent());
}

@Test
void theResultCarriesTheLatestVersionMarkerOnce() {
YamlMigrationEngine.Result result = engine.migrate("old: 1\nhost: h\n", new Steps());
Expand Down
Loading