rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

UnfoldProperties not working as expected with 4 space indentation

Open der-eismann opened this issue 1 month ago • 0 comments

  • I encountered this while testing https://github.com/openrewrite/rewrite-spring/issues/852. Is there any restriction to 2-space-intendation for this?

What version of OpenRewrite are you using?

I am using

  • OpenRewrite Maven plugin v6.24.0

How are you running OpenRewrite?

Running mvn rewrite:runNoFork --errors -Drewrite.resolvePropertiesInYaml=false -Drewrite.activeRecipes=... -Drewrite.configLocation=... in a multi-module project.

There is no config in the pom.xml.

What is the smallest, simplest way to reproduce the problem?

spring:
    datasource:
        url: jdbc:postgresql://localhost/test

spring.servlet.encoding.charset: UTF-8
spring.servlet.encoding.enabled: true
spring.servlet.encoding.force: true

What did you expect to see?

spring:
    datasource:
        url: jdbc:postgresql://localhost/test
    servlet:
        encoding:
            charset: UTF-8
            enabled: true
            force: true

What did you see instead?

spring:
    datasource:
        url: jdbc:postgresql://localhost/test

  spring:
      servlet:
          encoding:
              charset: UTF-8
spring:
    servlet:
        encoding:
            enabled: true
spring:
    servlet:
        encoding:
            force: true

When I use two spaces, it works as expected:

spring:
  datasource:
    url: jdbc:postgresql://localhost/test

spring.servlet.encoding.charset: UTF-8
spring.servlet.encoding.enabled: true
spring.servlet.encoding.force: true

to


spring:
  datasource:
    url: jdbc:postgresql://localhost/test
  servlet:
    encoding:
      charset: UTF-8
      enabled: true
      force: true

What is the full stack trace of any errors you encountered?

No errors

Are you interested in contributing a fix to OpenRewrite?

yes

der-eismann avatar Dec 01 '25 14:12 der-eismann