You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all - thank you for making black!
I'm applying it to my main project (Gammapy) today.
There are a few examples where I think that black gives non-ideal results, and wanted to mention them here. If those have been discussed before, I apologise, please just close this issue.
I think this is nice:
things=OrderedDict([
('ham', 'spam'),
('bla bla bla bla', 'some more text here'),
])
and putting [ and ] on a separate line like black does is not an improvement:
things=OrderedDict(
[
("ham", "spam"),
("bla bla bla bla", "some more text here"),
]
)
I read through the black description, and see that this is intended behaviour to always add line breaks on the outermost parenthesis. Is it possible / up for debate to change this in some cases?
This is another case:
text="""Hello halloallo allo"""[1:-1]
where black gives this output:
text = """
Hello hallo
allo allo
"""[
1:-1
]
and I think the input formatting is better readable than the black output.
The text was updated successfully, but these errors were encountered:
I agree that the formatting in your second example is terrible. That's because black treats those multiline strings as if they never fit a line. #256 tracks that.
I'm not so sure about your first example. I like that black makes it very explicit that we're passing a list instead of two parameters. On the other hand I see where you're coming from as the result is a bit more verbose.
What I don't like about the first example is that Black robs you of 4 precious spaces (yes I use 79 instead of 88). On the other hand, I agree that it's more explicit (a good thing).
First of all - thank you for making black!
I'm applying it to my main project (Gammapy) today.
There are a few examples where I think that black gives non-ideal results, and wanted to mention them here. If those have been discussed before, I apologise, please just close this issue.
I think this is nice:
and putting
[
and]
on a separate line like black does is not an improvement:I read through the black description, and see that this is intended behaviour to always add line breaks on the outermost parenthesis. Is it possible / up for debate to change this in some cases?
This is another case:
where black gives this output:
and I think the input formatting is better readable than the black output.
The text was updated successfully, but these errors were encountered: