Fixed extra space between '@' and decorator name

'@' is now a binary operator (see PY-15390), so the formatter surrounds
it with spaces. This change broke many formatter-related tests. We need
an extra rule for not adding spaces if '@' is used inside a decorator
statement.
This commit is contained in:
Andrey Vlasovskikh
2015-03-24 20:24:31 +03:00
parent a77b51054b
commit 3a1eeaa0f0
@@ -108,6 +108,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilderEx, C
.between(FROM_KEYWORD, DOT).spaces(1)
.between(DOT, IMPORT_KEYWORD).spaces(1)
.around(DOT).spaces(0)
.aroundInside(AT, DECORATOR_CALL).none()
.before(SEMICOLON).spaceIf(commonSettings.SPACE_BEFORE_SEMICOLON)
.withinPairInside(LPAR, RPAR, ARGUMENT_LIST).spaceIf(commonSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES)
.withinPairInside(LPAR, RPAR, PARAMETER_LIST).spaceIf(commonSettings.SPACE_WITHIN_METHOD_PARENTHESES)