-
Notifications
You must be signed in to change notification settings - Fork 507
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
Add new rule to rewrite the class signature #1349
Comments
fzyzcjy
changed the title
Indentation disagree with Intellij IDEA
Indentation disagree with Intellij IDEA for code like Jan 26, 2022
class A\n()
A new rule needs to be written to format class headers accordingly to the https://kotlinlang.org/docs/coding-conventions.html#class-headers |
paul-dingemans
added
enhancement
new rule
and removed
bug
indentation rule
enhancement
labels
Jan 26, 2022
paul-dingemans
changed the title
Indentation disagree with Intellij IDEA for code like
Add new rule to rewrite the class signature
Jan 26, 2022
class A\n()
We should close it if it's a duplicate I think |
Any updates on this one? |
Nope. Also it is not likely to be picked up soon, at least not by me. Please feel free to contribute if you would like to have this on short term. |
paul-dingemans
added a commit
that referenced
this issue
Jul 9, 2023
…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
paul-dingemans
added a commit
that referenced
this issue
Jul 21, 2023
* 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EDIT: I can workaround by avoiding writing code like this (instead let the constructor be at the same line with class name). I just want to report it so you can know that it happens, but please make this a low priority.
Hi thanks for the lib! For the following code, intellij idea thinks there should be 4 spaces at
(message: String?)
while ktlint thinks 0.The text was updated successfully, but these errors were encountered: