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

Force trailing commas #216

Closed
sidvenu opened this issue Apr 23, 2021 · 3 comments
Closed

Force trailing commas #216

sidvenu opened this issue Apr 23, 2021 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@sidvenu
Copy link

sidvenu commented Apr 23, 2021

Do we have the option to force the presence or absence of trailing commas? With its introduction in Kotlin, the codebase would potentially have a mix of both, and forcing the presence or absence of it would lead to consistency.

@blaugold
Copy link

👍 for automatic insertion of trailing commas based on some rule. Forcing the absence of trailing commas is simple, but forcing them wherever possible wouldn't make sense. Maybe force one if the list is spanning 2 or more lines.

@att14
Copy link

att14 commented Jul 14, 2022

It would be nice if ktfmt would have an opinion about either always trailing or never trailing, since right now, you can do either, and it leads to different behavior of the formatter. See #338.

@hick209 hick209 added the enhancement New feature or request label Sep 18, 2023
@hick209 hick209 added this to the ktfmt 1.0 milestone Jun 5, 2024
facebook-github-bot pushed a commit that referenced this issue Jun 18, 2024
Summary:
As requested on
#216
#442

Reviewed By: davidtorosyan

Differential Revision: D58585873

fbshipit-source-id: 61662ce4b21ad56b5554eb2275cd2e9341ccb1a4
@hick209 hick209 closed this as completed Jun 18, 2024
@hick209
Copy link
Contributor

hick209 commented Jun 18, 2024

cec9b50

github-merge-queue bot referenced this issue 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
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants