What version of OpenRewrite are you using?
Gradle plugin v7.32.0
How are you running OpenRewrite?
What is the smallest, simplest way to reproduce the problem?
Minimal reproducer: clone the project linked above as usual, then uncomment this line (deep link) and run ./gradlew rewriteRun. Observe git diff on ./modules/hcc-bootstrap/build.gradle.kts - the order of dependencies has changed, but the comments stayed where they were, making them misleading and confusing.
What did you expect to see?
If there is a comment preceding a dependency declaration, it must be moved along with the declaration. Better yet, it would be nice to have an ability to add an exclusion rule - as you can see from the linked code, it's pretty structured and better not be touched at all, unlike other build files that are trivial.
What did you see instead?
Please see the attached diff.
sort-dependencies.diff.txt
I'd love to, but I currently do not have bandwidth other than for contributing bug reports and testing bug fixes in pre-release versions.
What version of OpenRewrite are you using?
Gradle plugin v7.32.0
How are you running OpenRewrite?
What is the smallest, simplest way to reproduce the problem?
Minimal reproducer: clone the project linked above as usual, then uncomment this line (deep link) and run
./gradlew rewriteRun. Observe git diff on./modules/hcc-bootstrap/build.gradle.kts- the order of dependencies has changed, but the comments stayed where they were, making them misleading and confusing.What did you expect to see?
If there is a comment preceding a dependency declaration, it must be moved along with the declaration. Better yet, it would be nice to have an ability to add an exclusion rule - as you can see from the linked code, it's pretty structured and better not be touched at all, unlike other build files that are trivial.
What did you see instead?
Please see the attached diff.
sort-dependencies.diff.txt
Are you interested in contributing a fix to OpenRewrite?
I'd love to, but I currently do not have bandwidth other than for contributing bug reports and testing bug fixes in pre-release versions.