Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeYamlVisitor - inline comments not taken into account #2218

Closed
thomaszub opened this issue Sep 14, 2022 · 0 comments · Fixed by #4671
Closed

MergeYamlVisitor - inline comments not taken into account #2218

thomaszub opened this issue Sep 14, 2022 · 0 comments · Fixed by #4671
Assignees
Labels
bug Something isn't working

Comments

@thomaszub
Copy link
Contributor

Hi,

the MergeYamlVisitor does not take inline comments into account at merging YAMLs. See the test:

@Test
fun existingEntryBlockWithComment() = assertChanged(
    recipe = MergeYaml(
        "$",
        """
            spring:
              application:
                description: a description
        """.trimIndent(),
        false,
        null
    ),
    before = """
        spring:
          application:
            name: main #Some comment
    """,
    after = """
        spring:
          application:
            name: main #Some comment
            description: a description
    """
)

The actual result is:

spring:
  application:
    name: main
    description: a description #Some comment

Thanks and kind regards
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
2 participants