openrewrite / rewrite

Automated mass refactoring of source code.
https://docs.openrewrite.org
Apache License 2.0
2.03k stars 300 forks source link

UpgradeDependencyVersion inserting properties aren't formatted correctly #1473

Closed jkschneider closed 2 years ago

jkschneider commented 2 years ago

Problem

<jackson.version> isn't indented correctly. Also this shouldn't resort all tags. Note that the source encoding tag got bumped to the end of the set of properties here.

cc / @tkvangorder

Example diff

     <url>https://thingsboard.io</url>

     <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <jackson.version>2.12.6</jackson.version>
         <main.dir>${basedir}/../..</main.dir>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>

     <dependencies>

Recipes in example diff:

References:

tkvangorder commented 2 years ago

The indention of a property in the unit tests is working as expected, I am going to deploy the new snapshot to the SaaS and see if the indention issue is still present on this specific repo.

tkvangorder commented 2 years ago

Things are no longer sorted, but there is still an issue with auto-format.

tkvangorder commented 2 years ago

XML Formatting has been re-implemented (See #1477). Closing this issue.