Skip to content
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

'Missing newline before ")"' in long function names #327

Closed
jlmd opened this issue Jan 10, 2019 · 1 comment · May be fixed by mitutitu16/ktlint#1, mitutitu16/ktlint#2, mitutitu16/ktlint#3, mitutitu16/ktlint#4 or mitutitu16/ktlint#6

Comments

@jlmd
Copy link
Contributor

jlmd commented Jan 10, 2019

In ktlint version 0.29.0, there is an issue when a function name is too long. It's not common in normal functions, but it's when writing test functions using spaces. Example:

fun `any long function with more than 120 chars should only break 'Exceeded max line length (120)' and not any other rule`() {
   ...
}

When analyzing the code with ktlint, it says there are two broken rules:
Unexpected spacing after "("
Exceeded max line length (120)

In this case, the only broken rule should be Exceeded max line length (120), since adding a line break after the parenthesis when there are no parameters I think it does not make sense.

It was not happening in previous versions.

@jlmd jlmd changed the title 'Missing newline before ")"' in' long function names 'Missing newline before ")"' in long function names Jan 10, 2019
@shyiko shyiko closed this as completed in b6f9ad5 Feb 4, 2019
@shyiko
Copy link
Collaborator

shyiko commented Feb 4, 2019

Fixed in 0.30.0.

jlmd added a commit to jlmd/ktlint that referenced this issue Mar 31, 2019
Avoid checking "parameter-list-wrapping" rule when the element doesn't
have parameters.

Fixes pinterest#327
jlmd added a commit to jlmd/ktlint that referenced this issue Mar 31, 2019
Avoid checking "parameter-list-wrapping" rule when the element doesn't
have parameters.

Fixes pinterest#327
jlmd added a commit to jlmd/ktlint that referenced this issue Mar 31, 2019
Avoid checking "parameter-list-wrapping" rule when the element doesn't
have parameters.

Fixes pinterest#327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment