since pep8.py complains about blank lines after decorators, add rule to remove them

This commit is contained in:
Dmitry Jemerov
2012-10-02 20:04:46 +02:00
parent 6bb86279d1
commit aec0179906
4 changed files with 15 additions and 0 deletions
@@ -90,6 +90,9 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
.before(ARGUMENT_LIST).spaceIf(commonSettings.SPACE_BEFORE_METHOD_CALL_PARENTHESES)
.around(DECORATOR_CALL).spacing(1, Integer.MAX_VALUE, 0, true, 0)
.after(DECORATOR_LIST).spacing(1, Integer.MAX_VALUE, 0, true, 0)
.aroundInside(EQ, ASSIGNMENT_STATEMENT).spaceIf(commonSettings.SPACE_AROUND_ASSIGNMENT_OPERATORS)
.aroundInside(EQ, NAMED_PARAMETER).spaceIf(pySettings.SPACE_AROUND_EQ_IN_NAMED_PARAMETER)
.aroundInside(EQ, KEYWORD_ARGUMENT_EXPRESSION).spaceIf(pySettings.SPACE_AROUND_EQ_IN_KEYWORD_ARGUMENT)
@@ -0,0 +1,5 @@
@foo
@bar
def baz(): pass
@@ -0,0 +1,3 @@
@foo
@bar
def baz(): pass
@@ -179,6 +179,10 @@ public class PyFormatterTest extends PyTestCase {
doTest();
}
public void testBlankLineAfterDecorator() {
doTest();
}
public void testPsiFormatting() { // IDEA-69724
String initial =
"def method_name(\n" +