-
Notifications
You must be signed in to change notification settings - Fork 509
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
Unclear function-naming with wrong line/position #2260
Comments
The following snippet triggers the same behavior: Function name should start with a lowercase letter (except factory methods) and use camel case (standard:function-naming) with a wrong line and character position: fun truncateToPresent(todayRef: ZonedDateTime): (ZonedDateTime) -> ZonedDateTime =
fun (from: ZonedDateTime) = maxOf(from, todayRef) |
Tnx for reporting. The problem is not a wrong line/offset but that it does not recognize an anonymous function. In this example, no function name problem exists. Also, your example indicates another problem. No newline should be enforced when a function is used as right hand side in an assignment. |
…ent `blank-line-before-declaration` Closes #2260
…ent `blank-line-before-declaration` Closes #2260
Expected Behavior
I don't know what the style guide says, but surely the line numbers should at least be correct. Which in this case would be line 26 ff.
Observed Behavior
Steps to Reproduce
Run ktlint against a file containing the following snippet. In my case starting line 26.
Your Environment
The text was updated successfully, but these errors were encountered: