mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-15985: Don't suggest replacing a chained assignment with an augmented assignment
GitOrigin-RevId: 6022b2b19e28b4ea424ee1022e07be328d636ad3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1fef7c549e
commit
ae61422dff
+1
-1
@@ -74,7 +74,7 @@ public final class PyAugmentAssignmentInspection extends PyInspection {
|
||||
final PyExpression target = node.getLeftHandSideExpression();
|
||||
final PyBinaryExpression value = PyUtil.as(node.getAssignedValue(), PyBinaryExpression.class);
|
||||
|
||||
if (target != null && value != null) {
|
||||
if (target != null && value != null && node.getTargets().length == 1) {
|
||||
final PyExpression leftExpression = value.getLeftExpression();
|
||||
final PyExpression rightExpression = PyPsiUtils.flattenParens(value.getRightExpression());
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
var = 1
|
||||
var = foo = var + 1
|
||||
@@ -75,6 +75,9 @@ public class PyAugmentAssignmentInspectionTest extends PyInspectionTestCase {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
|
||||
}
|
||||
|
||||
// PY-15985
|
||||
public void testNotSuggestedForChainedTarget() { doTest(); }
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
Reference in New Issue
Block a user