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

Add support for Gradle assignment operator #479

Conversation

cloudshiftchris
Copy link
Contributor

Fixes #411.

Gradle added support for a Kotlin assignment operator to simplify property assignment.

This is done via a compiler plugin and this import: import org.gradle.kotlin.dsl.assign - which ktfmt detects as unused and removes.

This PR adds an assign operator to the operators in com.facebook.ktfmt.format.RedundantImportDetector and a corresponding test to ensure the import remains.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 11, 2024
@cloudshiftchris
Copy link
Contributor Author

cloudshiftchris commented Jun 11, 2024

builds failing due to unrelated commit 520706e / @strulovich / @hick209 that came along with the fork - looks like some dependency-hell between the IJ plugin depending on a stable version of ktfmt yet was updated to use new code that exists along-side it but is not yet in a published stable version.
Once that is addressed it can be merged in here.

@facebook-github-bot
Copy link
Contributor

@hick209 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@hick209
Copy link
Contributor

hick209 commented Jun 12, 2024

Yeah, I was actually the one that broke the tests and I have an internal diff that should fix that, don't worry about it.
Thanks for your contributions :)

@facebook-github-bot
Copy link
Contributor

@hick209 merged this pull request in 587a232.

@cloudshiftchris cloudshiftchris deleted the feature/add-assign-operator branch June 12, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect detection of unused import in Gradle Kotlin DSLs using new assignment operator
3 participants