Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix ParameterListWrappingRule to correctly identify misplaced left parens #201

Conversation

JelloRanger
Copy link
Contributor

Noticed a dev in my team writing code like this that passed Ktlint, so adding a quick fix here for it.

Sidenote: It feels like identifying dangling left parens should be part of a broader rule. Right now, the following code is valid according to Ktlint (athough I think it'd be pretty rare to see a dev actually write something like this, Ktlint should still probably catch it):

if
(someCondition) {
    doSomething()
}

However, given that this error is likely a lot more common in class/function headers I just added the fix there for now (also because we're handling right paren formatting in it). Let me know what you think though!

@shyiko
Copy link
Collaborator

shyiko commented May 1, 2018

Thanks once again, Jacob. Merging right in. 🏆

@shyiko shyiko merged commit e2aed32 into pinterest:master May 1, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants