-
Notifications
You must be signed in to change notification settings - Fork 509
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
ktlint indentation rule has problems with ignoring braces #1644
Comments
I think the solution to this is simply to make ktlint always perform a visit for each node. But for nodes that do not require format, we do not modify them |
zsqw123
changed the title
ktlint indentRule has problems with ignoring braces
ktlint indentation rule has problems with ignoring braces
Sep 11, 2022
5 tasks
paul-dingemans
added a commit
to zsqw123/ktlint
that referenced
this issue
Sep 16, 2022
Closes pinterest#1644
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
The following code should not be formatted
Observed Behavior
But when I run
ktlint -F
, I get the following.Steps to Reproduce
Your Environment
.editorconfig
Possible reasons
ktlint's indentation rule records the braces with a stack, and when I use
// ktlint-disable
on the line where the braces are, the indentation rule does not check thisASTNode
and the stack does not change, hence the problem.The text was updated successfully, but these errors were encountered: