0

I have an autogenerated file on which I run:

autopep8 --in-place --aggressive  --aggressive

The problem is that for default tuples, they are separated to multiple lines, and I want each tuple on their own line. For instance:

def function(
        x="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works",
        y="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works", hello=(0,)):
    print(x)
    print(y)
    print(hello)

is rendered to:

def function(
        x="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works",
        y="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works",
        hello=(
            0,
        )):
    print(x)
    print(y)
    print(hello)

(look at the hello parameter), but I want it to be:

def function(
        x="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works",
        y="One upon a time, there was a young man wanting to use autopep8, but he doesn't seem to understand how it works",
        hello=(0,)):
    print(x)
    print(y)
    print(hello)

Is this possible?

I've tried to only run single --aggressive, but that does not put all parameters on different lines, so I'm assuming that is not the answer. Additionally, these functions are autogenerated so it's hard to predict the length of each of the variables. I understand that this is a nice feature when having really long lists and/or tuples, but when the list/tuple does not exceed the "max-line-width", I don't see why it should do so.

Sombrero
  • 25
  • 5

0 Answers0