mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-12679 Remove redundant parenthesis: false negative for duplicated parenthesis in complicated and or statements
This commit is contained in:
@@ -108,6 +108,9 @@ public class PyRedundantParenthesesInspection extends PyInspection {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (expression instanceof PyParenthesizedExpression) {
|
||||
registerProblem(expression, "Remove redundant parentheses", new RedundantParenthesesQuickFix());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
if ((1 and 2 == 'left'<caret>)) or (3):
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
if (1 and 2 == 'left') or (3):
|
||||
pass
|
||||
@@ -205,6 +205,11 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
PyBundle.message("QFIX.redundant.parentheses"), true, true);
|
||||
}
|
||||
|
||||
public void testRedundantParenthesesParenthesizedExpression() { // PY-12679
|
||||
doInspectionTest("RedundantParenthesesParenthesizedExpression.py", PyRedundantParenthesesInspection.class,
|
||||
PyBundle.message("QFIX.redundant.parentheses"), true, true);
|
||||
}
|
||||
|
||||
public void testChainedComparisons() { // PY-1020
|
||||
doInspectionTest("ChainedComparisons.py", PyChainedComparisonsInspection.class,
|
||||
PyBundle.message("QFIX.chained.comparison"), true, true);
|
||||
|
||||
Reference in New Issue
Block a user