-
Notifications
You must be signed in to change notification settings - Fork 80
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 test examples for non-ideal situations #488
Conversation
Hi @snowe2010! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@davidtorosyan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding more tests! I left some comments about moving them to the right places / adjusting the options. This is mainly to help with maintainability (the more tests have the same set of options, the easier to reason about).
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Outdated
Show resolved
Hide resolved
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Outdated
Show resolved
Hide resolved
) | ||
|
||
@Test | ||
fun `complex calls and calculation in named parameters with wrapping`() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to FormatterTest.kt
, omit formattingOptions
if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so omitting the formatting options here showed another weird bug between google/kotlin formats. I moved it to FormatterTest and added another test to show the difference.
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Outdated
Show resolved
Hide resolved
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Show resolved
Hide resolved
remove formatting options where it's not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidtorosyan I also added one more test around if
expression functions
) | ||
|
||
@Test | ||
fun `complex calls and calculation in named parameters with wrapping`() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so omitting the formatting options here showed another weird bug between google/kotlin formats. I moved it to FormatterTest and added another test to show the difference.
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Outdated
Show resolved
Hide resolved
core/src/test/java/com/facebook/ktfmt/format/GoogleStyleFormatterKtTest.kt
Show resolved
Hide resolved
@hick209 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
We apologize for the delay. Let's try to get another look into this |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.facebook:ktfmt](https://togithub.com/facebookincubator/ktfmt) | dependencies | minor | `0.51` -> `0.52` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>facebookincubator/ktfmt (com.facebook:ktfmt)</summary> ### [`v0.52`](https://togithub.com/facebookincubator/ktfmt/blob/HEAD/CHANGELOG.md#052) ##### Fixed - IntelliJ plugin crash ([https://github.com/facebook/ktfmt/pull/501](https://togithub.com/facebook/ktfmt/pull/501)) - Ordering of `@property` and `@param` in KDoc ([https://github.com/facebook/ktfmt/pull/498](https://togithub.com/facebook/ktfmt/pull/498)) - Annotation in return expressions ([https://github.com/facebook/ktfmt/issues/497](https://togithub.com/facebook/ktfmt/issues/497)) ##### Changed - KotlinLang style also managing trailing commas ([https://github.com/facebook/ktfmt/issues/216](https://togithub.com/facebook/ktfmt/issues/216), [https://github.com/facebook/ktfmt/issues/442](https://togithub.com/facebook/ktfmt/issues/442)) - Converted IntelliJ plugin to Kotlin ([https://github.com/facebook/ktfmt/pull/502](https://togithub.com/facebook/ktfmt/pull/502)) ##### Added - More stability tests ([https://github.com/facebook/ktfmt/pull/488](https://togithub.com/facebook/ktfmt/pull/488)) - Custom profile in plugin settings, mirroring Gradle/Maven plugins ([https://github.com/facebook/ktfmt/pull/503](https://togithub.com/facebook/ktfmt/pull/503)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC40NS4wIiwidXBkYXRlZEluVmVyIjoiMzguNTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: Zac Sweers <[email protected]>
No description provided.