mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-28496, PY-27660 Remove unnecessary Normal Indent which violates PEP8 codestyle rules in multiline call chains
GitOrigin-RevId: 77e738367c33673c5c5f4b46472c3a49a5f64142
This commit is contained in:
committed by
intellij-monorepo-bot
parent
de3ab61998
commit
ded2dafba4
@@ -400,7 +400,7 @@ public class PyBlock implements ASTBlock {
|
||||
}
|
||||
else if (parentType == PyElementTypes.REFERENCE_EXPRESSION) {
|
||||
if (child != myNode.getFirstChildNode()) {
|
||||
childIndent = Indent.getNormalIndent();
|
||||
childIndent = Indent.getNoneIndent();
|
||||
if (hasLineBreaksBeforeInSameParent(child, 1)) {
|
||||
if (isInControlStatement()) {
|
||||
childIndent = Indent.getContinuationIndent();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
def get_queryset(self):
|
||||
return (
|
||||
super().get_queryset()
|
||||
.filter(user=self.request.user)
|
||||
.prefetch_related(
|
||||
'lines__oscar_line',
|
||||
'lines__oscar_line__product'
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
def get_queryset(self):
|
||||
return (
|
||||
super().get_queryset()
|
||||
.filter(user=self.request.user)
|
||||
.prefetch_related(
|
||||
'lines__oscar_line',
|
||||
'lines__oscar_line__product'
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
c = ["line"
|
||||
.casefold()
|
||||
.capitalize()
|
||||
.encode()
|
||||
]
|
||||
@@ -0,0 +1,5 @@
|
||||
c = ["line"
|
||||
.casefold()
|
||||
.capitalize()
|
||||
.encode()
|
||||
]
|
||||
@@ -0,0 +1,4 @@
|
||||
def func():
|
||||
return x.foo() \
|
||||
.bar() \
|
||||
.baz()
|
||||
@@ -0,0 +1,4 @@
|
||||
def func():
|
||||
return x.foo() \
|
||||
.bar() \
|
||||
.baz()
|
||||
@@ -1239,4 +1239,18 @@ public class PyFormatterTest extends PyTestCase {
|
||||
getCodeStyleSettings().setRightMargin(PythonLanguage.getInstance(), 20);
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-28496
|
||||
public void testHangingIndentsInMultilineCallChainInParenthesis() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-27660
|
||||
public void testHangingIndentsInMultilineCallChainInSquareBrackets() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMultiLineCallChainSplitByBackslashes() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user