-
Notifications
You must be signed in to change notification settings - Fork 502
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 rule for braces and code alignment #2001
Add rule for braces and code alignment #2001
Conversation
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.
Tnx for your contribution. I can see that you really picked up a lot of conventions that are used in the project. Well done and thanks for that. Most remarks are about little things that you missed. From a consistency perspective, I would like them to be refactored.
Please make sure to run gradle tasks test
and ktlintFormat
before pushing commits. This will reveal that your rule is not yet added to the StandardRuleSetProvider
and fixes formatting errors.
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEnd.kt
Outdated
Show resolved
Hide resolved
...in/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEndTest.kt
Outdated
Show resolved
Hide resolved
...in/com/pinterest/ktlint/ruleset/standard/rules/NoSameLineStatementAsOfBlockStartOrEndTest.kt
Outdated
Show resolved
Hide resolved
Hi, @paul-dingemans I have updated the PR with documentation, TCs with other cases. Please re-review |
I have refactored the rule and test quite a bit. The base however was solid and made it more easy for me to do this. So your effort is still appreciated. |
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.
Ready for merge in 1.0
Thanks @paul-dingemans. Let me know if there is more Up for grabs issue |
Would be cool if you want to help out more. It would be best if you connect to me on the kotlinlang slack, or have a look at https://github.com/pinterest/ktlint/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs. |
Description
Add rule such that code in function block should have new line in between braces and code
Closes #1938
Checklist
CHANGELOG.md
is updatedIn case of adding a new rule: