All Versions
Latest Version
Avg Release Cycle
78 days
Latest Release
879 days ago

Changelog History
Page 3

  • v0.16.1 Changes

    March 22, 2017

    ๐Ÿ”„ Changed

    • ๐Ÿ‘Œ Improved performance of cloning the format decision state object. This improved the time in one large case from 273.485s to 234.652s.
    • ๐Ÿ˜Œ Relax the requirement that a named argument needs to be on one line. Going over the column limit is more of an issue to pylint than putting named args on multiple lines.
    • Don't make splitting penalty decisions based on the original formatting. This can and does lead to non-stable formatting, where yapf will reformat the same code in different ways. ### ๐Ÿ›  Fixed
    • Ensure splitting of arguments if there's a named assign present.
    • Prefer to coalesce opening brackets if it's not at the beginning of a function call.
    • Prefer not to squish all of the elements in a function call over to the right-hand side. Split the arguments instead.
    • We need to split a dictionary value if the first element is a comment anyway, so don't force the split here. It's forced elsewhere.
    • Ensure tabs are used for continued indentation when USE_TABS is True.
  • v0.16.0 Changes

    February 05, 2017

    โž• Added

    • The EACH_DICT_ENTRY_ON_SEPARATE_LINE knob indicates that each dictionary entry should be in separate lines if the full dictionary isn't able to fit on a single line.
    • The SPLIT_BEFORE_DICT_SET_GENERATOR knob splits before the for part of a dictionary/set generator.
    • The BLANK_LINE_BEFORE_CLASS_DOCSTRING knob adds a blank line before a class's docstring.
    • The ALLOW_MULTILINE_DICTIONARY_KEYS knob allows dictionary keys to span more than one line. ### ๐Ÿ›  Fixed
    • Split before all entries in a dict/set or list maker when comma-terminated, even if there's only one entry.
    • ๐Ÿ Will now try to set O_BINARY mode on stdout under Windows and Python 2.
    • Avoid unneeded newline transformation when writing formatted code to output on (affects only Python 2)
  • v0.15.2 Changes

    January 29, 2017

    ๐Ÿ›  Fixed

    • Don't perform a global split when a named assign is part of a function call which itself is an argument to a function call. I.e., don't cause 'a' to split here:

      func(a, b, c, d(x, y, z=42))

    • ๐Ÿ‘ Allow splitting inside a subscript if it's a logical or bitwise operating. This should keep the subscript mostly contiguous otherwise.

  • v0.15.1 Changes

    January 21, 2017

    ๐Ÿ›  Fixed

    • Don't insert a space between a type hint and the '=' sign.
    • The '@' operator can be used in Python 3 for matrix multiplication. Give the '@' in the decorator a DECORATOR subtype to distinguish it.
    • Encourage the formatter to split at the beginning of an argument list instead of in the middle. Especially if the middle is an empty parameter list. This adjusts the affinity of binary and comparison operators. In particular, the "not in" and other such operators don't want to have a split after it (or before it) if at all possible.
  • v0.15.0 Changes

    January 12, 2017

    โž• Added

    • Keep type annotations intact as much as possible. Don't try to split the over multiple lines. ### ๐Ÿ›  Fixed
    • When determining if each element in a dictionary can fit on a single line, we are skipping dictionary entries. However, we need to ignore comments in our calculations and implicitly concatenated strings, which are already placed on separate lines.
    • ๐Ÿ‘ Allow text before a "pylint" comment.
    • Also allow text before a "yapf: (disable|enable)" comment.
  • v0.14.0 Changes

    November 21, 2016

    โž• Added

    • formatting can be run in parallel using the "-p" / "--parallel" flags. ### ๐Ÿ›  Fixed
    • "not in" and "is not" should be subtyped as binary operators.
    • A non-Node dictionary value may have a comment before it. In those cases, we want to avoid encompassing only the comment in pseudo parens. So we include the actual value as well.
    • Adjust calculation so that pseudo-parentheses don't count towards the total line length.
    • Don't count a dictionary entry as not fitting on a single line in a dictionary.
    • Don't count pseudo-parentheses in the length of the line.
  • v0.13.2 Changes

    October 22, 2016

    ๐Ÿ›  Fixed

    • REGRESSION: A comment may have a prefix with newlines in it. When calculating the prefix indent, we cannot take the newlines into account. Otherwise, the comment will be misplaced causing the code to fail.
  • v0.13.1 Changes

    October 17, 2016

    ๐Ÿ›  Fixed

    • ๐Ÿšš Correct emitting a diff that was accidentally removed.
  • v0.13.0 Changes

    October 16, 2016

    โž• Added

    • โž• Added support to retain the original line endings of the source code.

    ๐Ÿ›  Fixed

    • Functions or classes with comments before them were reformatting the comments even if the code was supposed to be ignored by the formatter. We now don't adjust the whitespace before a function's comment if the comment is a "disabled" line. We also don't count "# yapf: {disable|enable}" as a disabled line, which seems logical.
    • It's not really more readable to split before a dictionary value if it's part of a dictionary comprehension.
    • Enforce two blank lines after a function or class definition, even before a comment. (But not between a decorator and a comment.) This is related to PEP8 error E305.
    • โœ‚ Remove O(n2) algorithm from the line disabling logic.
  • v0.12.2 Changes

    October 09, 2016

    ๐Ÿ›  Fixed

    • ๐Ÿ’… If style.SetGlobalStyle(<create pre-defined style>) was called and then yapf_api.FormatCode was called, the style set by the first call would be lost, because it would return the style created by DEFAULT_STYLE_FACTORY, which is set to PEP8 by default. Fix this by making the first call set which factory we call as the "default" style.
    • Don't force a split before non-function call arguments.
    • A dictionary being used as an argument to a function call and which can exist on a single line shouldn't be split.
    • Don't rely upon the original line break to determine if we should split before the elements in a container. Especially split if there's a comment in the container.
    • Don't add spaces between star and args in a lambda expression.
    • If a nested data structure terminates in a comma, then split before the first element, but only if there's more than one element in the list.