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

Add spacing rule for UnaryExpression #798

Merged
merged 6 commits into from
Jun 30, 2020
Merged

Add spacing rule for UnaryExpression #798

merged 6 commits into from
Jun 30, 2020

Conversation

boyan01
Copy link
Contributor

@boyan01 boyan01 commented Jun 26, 2020

Add a rule to check spacing in KtUnaryExpression.

Example:

i++ // valid
i ++ // invalid

@boyan01
Copy link
Contributor Author

boyan01 commented Jun 26, 2020

I just noticed that already a pull request for unary op has been merged : #428

But I can not find any related files in master branch. Is there something wrong?

@Tapchicoma
Copy link
Collaborator

It was reverted in this commit: a08dfd1

@boyan01
Copy link
Contributor Author

boyan01 commented Jun 26, 2020

Suddenly thought of a case.

var i = - /*abc*/ 1  // it this should be valid?
i = -/*abc*/1 // or it this should be valid

I try to format this in IDEA, neither line of code is formatted..

@Tapchicoma
Copy link
Collaborator

I wonder who writes such code with inlined comments 😅

IMHO, second case should be proper one.

@boyan01 boyan01 requested a review from romtsn June 30, 2020 12:55
@romtsn romtsn merged commit a40a8b3 into pinterest:master Jun 30, 2020
@romtsn
Copy link
Collaborator

romtsn commented Jun 30, 2020

Thank you!

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.

3 participants