-
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
Comments/KDoc indentation not checked #297
Comments
fun foo() {
/**
* not detected
*/
/*
* not detected
*/
//
// detected
//
var foo = 1
foo += 1 // detected
foo -= 1
}
|
@shyiko You mean the code below should be allowed? fun foo() {
/*
* comment
*/
} In my opinion, the text in comment should be freeform, but starting fun foo() {
/*
* ugly
* indent
* in comment
* should be allowed
*/
/*
* ugly
* indent
* of comment head
* should not be allowed
*/
}
|
I would agree that |
The issue still (partly) exists in current 0.44.0 version. The KDoc and EOL comments are fixed. The incorrectly indented block comment is still undetected. Original example is now formatted as:
|
…omment when present Closes pinterest#297
…ailure on Windows Closes pinterest#297
It'd be nice if this also hard-wrapped KDoc (Javadoc) lines at some standard margin. So that, with an 80-character margin for example,
is reformatted to
|
This is not related to the original issue. Also, I don't think that KDOC should be wrapped. If you really would like to have such functionality it is best to write a custom rule for it. See https://pinterest.github.io/ktlint/api/custom-rule-set/ for a starting point to create a custom rule. |
In the following code, only the last two errors in indentation are detected:
The text was updated successfully, but these errors were encountered: