-
Notifications
You must be signed in to change notification settings - Fork 510
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 option to define length of a "long supertype list" in Class header #875
Comments
I second this. I do not really know what exactly "too long" is, but I see constructors with 200+ characters in a single line which definitely is violating the style guide. |
The max-line-length rule will disallow such constructors if the corresponding |
…consistent format. In code style `ktlint_official`, super types are always wrapped to a separate line. In other code styles, super types are only wrapped in classes having multiple super types. Especially for code style `ktlint_official` the class headers are rewritten in a more consistent format. Closes #875 Closes #1349
The new Given input below:
will be formatted in
while in code styles
|
* Add rule `class-signature`. This rule rewrites the class header to a consistent format. In code style `ktlint_official`, super types are always wrapped to a separate line. In other code styles, super types are only wrapped in classes having multiple super types. Especially for code style `ktlint_official` the class headers are rewritten in a more consistent format. Closes #875 Closes #1349 * Add disallowed comments locations for value argument, type argument, value parameter and type parameter lists so that the ClassSignatureRule does not need to check for this * Fix indentation for class having explicit constructor in ktlint_official code style
Jetbrains Class header formatting coding conventions
They state that:
and provide a sample
But they also state the following:
With the attached code sample
But they don't mention what is considered a long supertype list and what is not, which means it should be opened for discussion and an option to change that number.
I personally would love to change the number of interfaces.
Another issue is that it's very hard to understand the issue with the current message:
I think it should have a proper message along the lines of
The text was updated successfully, but these errors were encountered: