-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixes for FileStructureRule #636
Conversation
### What's done: * Fixed logic * Added tests
Codecov Report
@@ Coverage Diff @@
## master #636 +/- ##
============================================
+ Coverage 80.75% 80.82% +0.07%
- Complexity 1765 1771 +6
============================================
Files 90 90
Lines 4656 4663 +7
Branches 1403 1407 +4
============================================
+ Hits 3760 3769 +9
+ Misses 318 317 -1
+ Partials 578 577 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
### What's done: * Code style
…ow-ups#267' into feature/file-structure-rule-follow-ups#267
### What's done: * Code style
### What's done: * Code style
val otherNodesBeforeCode = firstCodeNode.siblings(forward = false) | ||
.filterNot { | ||
it.isWhiteSpace() || | ||
it == copyrightComment || it == headerKdoc || it == fileAnnotations |
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.
What about EOL comments? Do we need to handle it here?
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.
We state the following structure (as per our code style): copyright information is placed in a block comment, general file comment is placed in KDoc. All other nodes that can appear before code, including EOL comments, are captured here.
* This is an example | ||
*/ | ||
|
||
// some notes on this file |
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.
Maybe it's better to add comments into KDoc?
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.
I check that EOL comments are moved correctly here, why would I need KDoc instead?
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.
I thought it would be better to have one KDOC than KDOC and EOL, but I think so well)
@@ -0,0 +1,11 @@ | |||
// some notes on this file |
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.
Why COMMENT_BLOCK
doesn't move exactly like the comment
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.
If there is a BLOCK_COMMENT
before code, it's considered as containing copyright information. But you are right, I need to check copyright keywords too, like we do in some other rule.
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
What's done:
This pull request closes #267