-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
False positives for google_checks when using switch expression in lambda #16949
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
base: master
Are you sure you want to change the base?
False positives for google_checks when using switch expression in lambda #16949
Conversation
…switch expression in lambdaك
827139e
to
43cd3db
Compare
@Abdelrhmansersawy , ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid dry if possible
// Check for assignment context (from PR #16418) | ||
if (TokenUtil.isOfType(grandParent, TokenTypes.ASSIGN)) { | ||
indentLevel = new IndentLevel(indentLevel, | ||
getIndentCheck().getLineWrappingIndentation()); | ||
} | ||
// Check for lambda context | ||
else if (TokenUtil.isOfType(grandParent, TokenTypes.LAMBDA)) { | ||
indentLevel = new IndentLevel(indentLevel, | ||
getIndentCheck().getLineWrappingIndentation()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Check for assignment context (from PR #16418) | |
if (TokenUtil.isOfType(grandParent, TokenTypes.ASSIGN)) { | |
indentLevel = new IndentLevel(indentLevel, | |
getIndentCheck().getLineWrappingIndentation()); | |
} | |
// Check for lambda context | |
else if (TokenUtil.isOfType(grandParent, TokenTypes.LAMBDA)) { | |
indentLevel = new IndentLevel(indentLevel, | |
getIndentCheck().getLineWrappingIndentation()); | |
} | |
// Check for assignment and lambda context (from PR #16418) | |
if (TokenUtil.isOfType(grandParent, TokenTypes.ASSIGN) || TokenUtil.isOfType(grandParent, TokenTypes.LAMBDA)) { | |
indentLevel = new IndentLevel(indentLevel, | |
getIndentCheck().getLineWrappingIndentation()); | |
} |
avoid dry if possible
I’ve stopped working on this PR because there is another PR#16721 that addresses a different false-positive issue, which also happens to resolve this one. What’s your opinion on continuing to solve this issue separately, or should we rely on the open PRs since they’ve made significant progress and only need a few more steps to be completed? |
Issue #16762