yapf v0.27.0 Release Notes
Release Date: 2019-04-07 // almost 5 years ago-
โ Added
SPLIT_BEFORE_ARITHMETIC_OPERATOR
splits before an arithmetic operator when set.SPLIT_PENALTY_ARITHMETIC_OPERATOR
allows you to set the split penalty around arithmetic operators. ### ๐ Changed- ๐ป Catch lib2to3's "TokenError" exception and output a nicer message. ### ๐ Fixed
- ๐ Parse integer lists correctly, removing quotes if the list is within a string.
- Adjust the penalties of bitwise operands for '&' and '', similar to '|'.
- Avoid splitting after opening parens if SPLIT_BEFORE_FIRST_ARGUMENT is set to False.
- Adjust default SPLIT_PENALTY_AFTER_OPENING_BRACKET.
- Re-enable removal of extra lines on the boundaries of formatted regions.
- Adjust list splitting to avoid splitting before a dictionary element, because those are likely to be split anyway. If we do split, it leads to horrible looking code.
- Dictionary arguments were broken in a recent version. It resulted in unreadable formatting, where the remaining arguments were indented far more than the dictionary. Fixed so that if the dictionary is the first argument in a function call and doesn't fit on a single line, then it forces a split.
- ๐ Improve the connectiveness between items in a list. This prevents random splitting when it's not 100% necessary.
- ๐ Don't remove a comment attached to a previous object just because it's part of the "prefix" of a function/class node.