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

Remove code that was inserting newline after = in a chained call #387

Merged
merged 5 commits into from
May 23, 2019

Conversation

shashachu
Copy link
Contributor

@shashachu
Copy link
Contributor Author

@vanniktech thoughts on this one? I just removed the code that was inserting the newline after the = because it felt more like a bug than a feature.

Copy link
Contributor

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not totally certain that I'm on board with this change.

@shashachu
Copy link
Contributor Author

I re-introduced the rule for raw strings but removed the rest. I also added a test verifying the linebreak after = in chained calls is still allowed, just not forced.

val x =
"a" +
"b2"
val x = "a" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know if this better...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really? it seems better to me. but the previous formatting is still allowed, just not forced.

) + f1(
"sssss"
)
val x = paths.flatMap { dir ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does seem slightly better, though

get() =
this.javaClass.name
.fn()
get() = this.javaClass.name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am also unsure here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both look bad to me, but the extra newline irks me. maybe it's just me. :)

@shashachu shashachu merged commit 5658473 into pinterest:master May 23, 2019
@shashachu shashachu deleted the extra-newline branch May 23, 2019 00:12
sowmyav24 pushed a commit to sowmyav24/ktlint that referenced this pull request Jun 10, 2019
…terest#387)

* Remove code that was inserting newline after = except for raw strings
sowmyav24 pushed a commit to sowmyav24/ktlint that referenced this pull request Jun 10, 2019
…terest#387)

* Remove code that was inserting newline after = except for raw strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IndentationRule inserting unnecessary line break after assignment followed by any continuation
3 participants