mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-10364 Print statement -> function inspection is not PEP-8 compatible
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ public class CompatibilityPrintCallQuickFix implements LocalQuickFix {
|
||||
}
|
||||
|
||||
private static void replacePrint(PsiElement expression, PyElementGenerator elementGenerator) {
|
||||
StringBuilder stringBuilder = new StringBuilder("print (");
|
||||
StringBuilder stringBuilder = new StringBuilder("print(");
|
||||
|
||||
PyExpression[] target = PsiTreeUtil.getChildrenOfType(expression, PyExpression.class);
|
||||
if (target != null) {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<warning descr="Python version >= 3.0 do not support this syntax. The print statement has been replaced with a print() function">print <caret>"foo"</warning>
|
||||
@@ -0,0 +1 @@
|
||||
print("foo")
|
||||
@@ -81,6 +81,10 @@ public class PyQuickFixTest extends PyTestCase {
|
||||
doInspectionTest("AddSelf.py", PyMethodParametersInspection.class, PyBundle.message("QFIX.add.parameter.self", "self"), true, true);
|
||||
}
|
||||
|
||||
public void testReplacePrint() {
|
||||
doInspectionTest("ReplacePrint.py", PyCompatibilityInspection.class, PyBundle.message("QFIX.statement.effect"), true, true);
|
||||
}
|
||||
|
||||
public void testAddSelfFunction() { //PY-4556
|
||||
doInspectionTest("AddSelfFunction.py",
|
||||
PyUnresolvedReferencesInspection.class, PyBundle.message("QFIX.unresolved.reference", "get_a", "self"), true, true);
|
||||
|
||||
Reference in New Issue
Block a user