-
Notifications
You must be signed in to change notification settings - Fork 506
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
Check extra whitespace success, but check extra tab character in the begin of line does not work #425
Comments
@ElenaSpb can you give a small code snippet demonstrating the issue? Thanks! |
I'm not sure if this is related, but this code snippet does not provoke an error in KtLint, which it should: class Foo {
private fun doBar(): Int =
if (somethingIsTrue) {
doThis()
} else {
doThat()
}
...
} Notice how the indentation of the |
@realdadfish I think he means this case:
So this case it succeeds when linting although there's an extra tab on the |
additionally - if package in class is not the same as location - it does not show such errors.. |
@ElenaSpb I run into the same issue. How did you change the configuration to fix this? |
@ggajews is it happening for you as well? |
execuse me - I thought I leave previos comment (about fixing with configuration) in another issue. |
@Tapchicoma yes, we are using spaces for formatting, and if I add a random tab in the line, ktlint does not report it. |
Problem is that lines that are properly indented at the correct level but are using the wrong indentation style (tabs instead of space or vice versa) are not autocorrected. In the example of this issue, only the the improperly indented lines were fixed. PR is on its way. |
…g indentation style (pinterest#425)
…g indentation style (pinterest#425) (pinterest#1031) Co-authored-by: Paul Dingemans <pdingemans@bol.com>
gradle task ktlint failed if there are extra whitespaces with
error line="9" column="1" severity="error" message="Unexpected indentation (11) (it should be 8) (cannot be auto-corrected)" source="indent"
for example.
but if there are extra tab character in the begining of line - the task finish success, which is not expected.
The text was updated successfully, but these errors were encountered: