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

Issue#174 If then block should start with { and end with } #228

Merged
merged 3 commits into from
Jun 23, 2018

Conversation

yokotaso
Copy link
Contributor

Thank you for developing wonderful tool!

I found this issue,
#174

And then, I tried to develop IfThenBlockWithCurlyBraceRule.
If you have a free time, Cloud you review it?

if (node.elementType == KtNodeTypes.THEN) {
assert(node.treeParent.elementType == KtNodeTypes.IF)
// Check Whether Block Element start with `{`
if (node.firstChildNode.firstChildNode.elementType != KtTokens.LBRACE) {
Copy link
Contributor Author

@yokotaso yokotaso Jun 16, 2018

Choose a reason for hiding this comment

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

Is it needed nullable check?

}
}
// Check Whether Block Element end with `}`
if (node.lastChildNode.lastChildNode.elementType != KtTokens.RBRACE) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it nullable check needed?

@shyiko
Copy link
Collaborator

shyiko commented Jun 23, 2018

I'm sorry, Tomoya. I somehow managed to miss the notification about this PR. Merging in! 🙇‍♂️

@shyiko shyiko merged commit 79f9afa into pinterest:master Jun 23, 2018
@yokotaso yokotaso deleted the Issue-174 branch June 25, 2018 08:24
@yokotaso
Copy link
Contributor Author

@shyiko Thank you for merging PR! 🙇

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.

2 participants