-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Proposal to use Scalafmt with the Scala files #4965
Conversation
This is ready to be reviewed, the tests are failing because of misformatted files which I will resolve after I get all the feedbacks. |
As discussed on the mailing list https://lists.apache.org/thread.html/3afa79db248e7b6052a0e53bd5c5060e82412a0e83d06ba6dc5725e9@%3Cdev.kafka.apache.org%3E Please feel free to comment on formatting that feels weird. |
@ijuma @guozhangwang @debasishg What are your thoughts on this? I understand from the mailing list that the streams module is good to go? |
👍 for having this in streams module. |
@joan38 the plan sounds good. I'll try to take a look at the actual rules soon. We should try and get that right so that we don't have to reformat again. |
Indeed the rules need to be right from the beginning. Let me know what looks best for you. |
@ijuma have you been able to play with the settings and see what's best? |
@ijuma @guozhangwang @debasishg do you guys have some time to review this? I'm worried this is going stall. |
Sorry, it's the KIP freeze for the next release tomorrow and everyone is busy reviewing KIPs at the moment. |
Make sense let's have a look later then. |
@ijuma @guozhangwang @debasishg should we move forward with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except one minor question, other rules lgtm.
Could you rebase?
maxColumn = 120 | ||
continuationIndent.defnSite = 2 | ||
assumeStandardLibraryStripMargin = true | ||
danglingParentheses = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
danglingParentheses default seems to be true already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is since 1.6.0 but here we are stuck on 1.5.1 so I specified it explicitly.
This PR diffplug/spotless#260 is the fix for us to be able to upgrade to Scalafmt 1.6.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I would merge this PR to get Streams to follow these rules, and @ijuma can take another pass and see if we'd like to propagate to other modules.
Reviewers: Guozhang Wang <wangguoz@gmail.com>
Cherry-picked to 2.0 as well. |
This eliminates the different people's opinion on coding style and makes the codebase consistant.
I put arbitrary rules, let me know your thoughts.
Committer Checklist (excluded from commit message)