prettier / plugin-python

Prettier Python Plugin
MIT License
517 stars 41 forks source link

Multiline default args ordering fix #78

Closed ryanashcraft closed 6 years ago

ryanashcraft commented 6 years ago

Before, printArguments seemed to assume all args were on the same line, resulting in mixed-up default assignments.

Here's the new test case in default_args.py without the change:

./node_modules/.bin/prettier  --plugin=. --parser=python tests/python_default_args/default_args.py 
def hello(x, a=123, b=456):
    print("hello world", a)

def my_func_with_many_args(
    self,
    var_a=None,
    var_b,
    var_c,
    var_d=None,
    var_e,
    var_f,
    var_g=None,
    var_h,
    var_i=None,
    var_j,
    =None
):
    pass
patrick91 commented 6 years ago

Thank you!

FuegoFro commented 6 years ago

Nice!