allow wrapping in imports (PY-9163)

This commit is contained in:
Dmitry Jemerov
2013-11-12 14:41:26 +01:00
parent 4a8a702e4d
commit bfc761dff8
4 changed files with 10 additions and 1 deletions
@@ -146,7 +146,8 @@ public class PyBlock implements ASTBlock {
childIndent = Indent.getNormalIndent();
}
}
else if (childType == PyElementTypes.IMPORT_ELEMENT && hasLineBreaksBefore(child, 1)) {
else if (childType == PyElementTypes.IMPORT_ELEMENT) {
wrap = Wrap.createWrap(WrapType.NORMAL, true);
childIndent = Indent.getNormalIndent();
}
if (ourListElementTypes.contains(parentType)) {
+1
View File
@@ -0,0 +1 @@
from common.resources.health import URLHealthCheck, JSONURLHealthCheck, HealthHandler, HealthResult
@@ -0,0 +1,2 @@
from common.resources.health import URLHealthCheck, JSONURLHealthCheck, \
HealthHandler, HealthResult
@@ -345,6 +345,11 @@ public class PyFormatterTest extends PyTestCase {
doTest();
}
public void testWrapImports() { // PY-9163
settings().RIGHT_MARGIN = 80;
doTest();
}
private void doTest() {
doTest(false);
}