Comments (2)
Looks like this is intentional, going by the comments in the code
(Btw. that comment seems to have a mistake. I guess it should say, "Lists that fit on one line will have them removed.")
ktfmt/core/src/main/java/com/facebook/ktfmt/format/TrailingCommas.kt
Lines 64 to 78 in cec9b50
Personally, I would also prefer if anything with two arguments would be formatted on multiple lines with trailing commas.
Edit: after using 0.52 a bit, I feel strongly that more than one argument should go on separate lines. The whole point of trailing commas is to make merge conflicts easier, isn't it? That should not depend on whether it fits on one line.
from ktfmt.
I rolled back to even 0.50
and am seeing this constructor
snafu showing up.
We had this:
class RealSettingsWorkflow @Inject constructor(
private val oAuthTokenService: OAuthTokenService,
@UserId private val userId: String,
@VersionName private val versionName: String,
) : StatefulWorkflow<Unit, SettingsState, RootOutput, BodyAndOverlaysScreen<Screen, Overlay>>() {
is now:
class RealSettingsWorkflow
@Inject
constructor(
private val oAuthTokenService: OAuthTokenService,
@UserId private val userId: String,
@VersionName private val versionName: String,
) :
StatefulWorkflow<Unit, SettingsState, RootOutput, BodyAndOverlaysScreen<Screen, Overlay>>() {
I am using spotless
, but I don't think it is causing this since it delegates to ktfmt
. As an ex-Square
, I do agree that the Square
method is much easier to read. This current format it both ugly and makes me have to move my eyes down to see important information.
from ktfmt.
Related Issues (20)
- Misspelled flags in CLI can cause user data loss HOT 1
- How can I config Intellij plugin? HOT 2
- error: did not generate token "context" HOT 3
- Google style with trailing comma does not use maxWidth correctly HOT 2
- Nested function calls with named parameters is incredibly difficult to read and results in unnecessary nesting HOT 8
- ktfmt 0.51 incompatible with Spotless Gradle plugin HOT 2
- Consider providing a binary jar HOT 8
- ver 1.1.0.51 update breaks ktfmt intellij plugin setting screen if style is "Dropbox" HOT 4
- IDEA plugin v1.1.0.51 with Kotlinlang formats incorrectly HOT 3
- Unexpected change in Kotlinlang formatting HOT 1
- Missing jar for version 0.51 HOT 4
- Version 1.1.0.51 does not format correctly for style "Kotlinlang" HOT 9
- idea plugin is incompatible with idea 2024.2 beta
- Kotlin 2.0.20-Beta2: Exception when parsing a property accessor HOT 8
- Unnecessary line return inserted in expression HOT 2
- Formatting of annotations on return statements HOT 3
- Stuck on ktfmt settings HOT 2
- Usage tabs on playground page don't work HOT 4
- 0.52 release did not get completed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktfmt.