-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
F: linetoolongBlack makes our lines too longBlack makes our lines too longT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Operating system: macos 10.14.4
Python version: 3.6.7
Black version: 19.3b0
Does also happen on master: Yes
We have an interesting way to create pytest fixtures. We've created a function called lambda_fixture()
that lets us skip most of the boilerplate issues when creating fixtures. It looks something like this:
my_user = lambda_fixture(lambda user_factory: user_factory(name='Mike'))
That's all well and good, but sometimes these things can have a pretty long list of parameters. Unfortunately, black doesn't handle this very well:
my_long_variable_name = lambda_fixture(
lambda fixture_1, another_long_fixture_name, some_fixture_factory, some_long_fixture_name_again, short, wow, long_fixture_name: some_fixture_factory.create_batch(
size=10,
something=short,
something_else=long_fixture_name,
)
)
It would be nice to have black wrap and/or chop down the lambda parameter list. Bonus points if the indent of the wrap/chop is different than the indent of the body of the lambda.
kmaork
Metadata
Metadata
Assignees
Labels
F: linetoolongBlack makes our lines too longBlack makes our lines too longT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?