-
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
Bugfix in the LineLength rule #929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #929 +/- ##
=========================================
Coverage 84.14% 84.14%
Complexity 2373 2373
=========================================
Files 101 101
Lines 6006 6006
Branches 1772 1772
=========================================
Hits 5054 5054
Misses 263 263
Partials 689 689
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
} | ||
|
||
private fun validateAccessors(node: ASTNode, propsWithBackSymbol: List<String>) { | ||
val accessors = node.findAllDescendantsWithSpecificType(PROPERTY_ACCESSOR).filter { it.hasChildOfType(BLOCK) } // exclude get with expression body |
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.
Is this the line that caused an error? Could you make this example more minimal, e.g. the logic
function doesn't have anything to do with line length 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.
Thanks, agree, now this test is more compact
### What's done: * Minimize test
…bugfix/line_length_bug
What's done:
Explanation:
When we looking for the node, which code len is greater than limit, we should keep in mind, that
if
limit = 120
, it means, that the119
symbol, i.e.119
element from code line array exceeds the limit.But previously, in
we took the
120
element, which offset is actually121
and so NPE appeared insince
configuration.lineLength.toInt() == 120
andleftOffset == 121