-
Notifications
You must be signed in to change notification settings - Fork 81
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 more settings to IJ Plugin UI #503
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Aug 12, 2024
@hick209 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
hick209
approved these changes
Aug 13, 2024
cortinico
approved these changes
Aug 14, 2024
github-merge-queue bot
referenced
this pull request
in slackhq/foundry
Aug 28, 2024
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 <pandanomic@gmail.com>
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed on Slack, this PR exposes the existing settings (
FormattingOptions
) in the IJ plugin UI. This brings the IJ plugin in line with the Gradle one.There is also a migration from the old settings (
enabled
as a boolean) to the new ones (enableKtfmt
as an enum) that allows us to drop a bunch of legacy code and use better, Kotlin-friendly APIs. I (manually) tested both migrating from old settings (enabled and disabled) and starting anew, and it works fine. I have already used a similar strategy in the detekt plugin, and it worked well there, too.The new Custom option
Screen.Recording.2024-08-12.at.19.01.42.mov
When selecting the Custom option, users can freely choose a max line length, indent/continuation indent size, and whether ktfmt should be managing imports and trailing commas. The UI will display validation errors if the numeric values are invalid (not shown above). It also allows to use one of the presets as starting points for customizing, which I expect will be a pretty common use case — e.g., I may want to use Meta's style, but with longer lines.