All Versions
51
Latest Version
Avg Release Cycle
78 days
Latest Release
1216 days ago

Changelog History
Page 1

  • v0.32.0 Changes

    December 26, 2021

    โž• Added

    • ๐Ÿ‘€ Look at the 'pyproject.toml' file to see if it contains ignore file information for YAPF.
    • ๐Ÿ†• New entry point yapf_api.FormatTree for formatting lib2to3 concrete syntax trees.
    • โž• Add CI via GitHub Actions. ### ๐Ÿ”„ Changes
    • ๐Ÿ”„ Change tests to support "pytest".
    • Reformat so that "flake8" is happy.
    • ๐Ÿ‘‰ Use GitHub Actions instead of Travis for CI.
    • Clean up the FormatToken interface to limit how much it relies upon the pytree node object.
    • Rename "unwrapped_line" module to "logical_line."
    • ๐Ÿ“‡ Rename "UnwrappedLine" class to "LogicalLine." ### ๐Ÿ›  Fixed
    • โž• Added pyproject extra to install toml package as an optional dependency.
    • Enable BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF knob for "pep8" style, so method definitions inside a class are surrounded by a single blank line as prescribed by PEP8.
    • ๐Ÿ›  Fixed the '...' token to be spaced after a colon.
  • v0.31.0 Changes

    March 14, 2021

    โž• Added

    • ๐Ÿ“‡ Renamed 'master' brannch to 'main'.
    • Add 'BLANK_LINES_BETWEEN_TOP_LEVEL_IMPORTS_AND_VARIABLES' to support setting a custom number of blank lines between top-level imports and variable definitions.
    • Ignore end of line # copybara: directives when checking line length.
    • ๐Ÿ’… Look at the 'pyproject.toml' file to see if it contains style information for YAPF. ### ๐Ÿ”„ Changed
    • Do not scan excluded directories. Prior versions would scan an excluded folder then exclude its contents on a file by file basis. Preventing the folder being scanned is faster. ### ๐Ÿ›  Fixed
    • ๐Ÿ Exclude directories on Windows.
  • v0.30.0 Changes

    April 23, 2020

    โž• Added

    • Added SPACES_AROUND_LIST_DELIMITERS, SPACES_AROUND_DICT_DELIMITERS, and SPACES_AROUND_TUPLE_DELIMITERS to add spaces after the opening- and before the closing-delimiters for lists, dicts, and tuples.
    • Adds FORCE_MULTILINE_DICT knob to ensure dictionaries always split, even when shorter than the max line length.
    • New knob SPACE_INSIDE_BRACKETS to add spaces inside brackets, braces, and parentheses.
    • New knob SPACES_AROUND_SUBSCRIPT_COLON to add spaces around the subscript / slice operator. ### ๐Ÿ”„ Changed
    • ๐Ÿ’… Renamed "chromium" style to "yapf". Chromium will now use PEP-8 directly.
    • CONTINUATION_ALIGN_STYLE with FIXED or VALIGN-RIGHT now works with space indentation. ### ๐Ÿ›  Fixed
    • Honor a disable directive at the end of a multiline comment.
    • Don't require splitting before comments in a list when SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES is set. The knob is meant for values, not comments, which may be associated with the current line.
    • Don't over-indent a parameter list when not needed. But make sure it is properly indented so that it doesn't collide with the lines afterwards.
    • Don't split between two-word comparison operators: "is not", "not in", etc.
  • v0.29.0 Changes

    November 28, 2019

    โž• Added

    • โž• Add the --quiet flag to suppress output. The return code is 1 if there are changes, similarly to the --diff flag.
    • Add the indent_closing_brackets option. This is the same as the dedent_closing_brackets option except the brackets are indented the same as the previous line. ### ๐Ÿ”„ Changed
    • Collect a parameter list into a single object. This allows us to track how a parameter list is formatted, keeping state along the way. This helps when supporting Python 3 type annotations.
    • Catch and report UnicodeDecodeError exceptions.
    • ๐Ÿ‘Œ Improved description of .yapfignore syntax. ### ๐Ÿ›  Fixed
    • ๐Ÿ†“ Format subscript lists so that splits are essentially free after a comma.
    • Don't add a space between a string and its subscript.
    • ๐Ÿ’… Extend discovery of '.style.yapf' & 'setup.cfg' files to search the root directory as well.
    • ๐Ÿ‘‰ Make sure we have parameters before we start calculating penalties for splitting them.
    • Indicate if a class/function is nested to ensure blank lines when needed.
    • ๐Ÿ›  Fix extra indentation in async-for else statement.
    • A parameter list with no elements shouldn't count as exceeding the column limit.
    • When splitting all comma separated values, don't treat the ending bracket as special.
    • The "no blank lines between nested classes or functions" knob should only apply to the first nested class or function, not all of them.
  • v0.28.0 Changes

    July 11, 2019

    โž• Added

    • New knob SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES is a variation on SPLIT_ALL_COMMA_SEPARATED_VALUES in which, if a subexpression with a comma fits in its starting line, then the subexpression is not split (thus avoiding unnecessary splits). ### ๐Ÿ”„ Changed
    • Set INDENT_DICTIONARY_VALUE for Google style.
    • Set JOIN_MULTIPLE_LINES = False for Google style. ### ๐Ÿ›  Fixed
    • BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=False wasn't honored because the number of newlines was erroneously calculated beforehand.
    • Lambda expressions shouldn't have an increased split penalty applied to the 'lambda' keyword. This prevents them from being properly formatted when they're arguments to functions.
    • A comment with continuation markers (??) shouldn't mess with the lineno count.
    • Only emit unformatted if the "disable long line" is at the end of the line. Otherwise we could mess up formatting for containers which have them interspersed with code.
    • ๐Ÿ›  Fix a potential race condition by using the correct style for opening a file which may not exist.
  • v0.27.0 Changes

    April 07, 2019

    โž• 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.
  • v0.26.0 Changes

    February 08, 2019

    โž• Added

    • ALLOW_SPLIT_BEFORE_DEFAULT_OR_NAMED_ASSIGNS allows us to split before default / named assignments.
    • ARITHMETIC_PRECEDENCE_INDICATION removes spacing around binary operators if they have higher precedence than other operators in the same expression. ### ๐Ÿ”„ Changed
    • SPACES_BEFORE_COMMENT can now be assigned to a specific value (standard behavior) or a list of column values. When assigned to a list, trailing comments will be horizontally aligned to the first column value within the list that is greater than the maximum line length in the block.
    • ๐Ÿ‘• Don't modify the vertical spacing of a line that has a comment "pylint: disable=line-too-long". The line is expected to be too long.
    • improved CONTINUATION_ALIGN_STYLE to accept quoted or underline-separated option value for passing option with command line arguments. ### ๐Ÿ›  Fixed
    • When retrieving the opening bracket make sure that it's actually an opening bracket.
    • Don't completely deny a lambda formatting if it goes over the column limit. Split only if absolutely necessary.
    • โฌ†๏ธ Bump up penalty for splitting before a dot ('.').
    • Ignore pseudo tokens when calculating split penalties.
    • Increase the penalty for splitting before the first bit of a subscript.
    • ๐Ÿ‘Œ Improve splitting before dictionary values. Look more closely to see if the dictionary entry is a container. If so, then it's probably split over multiple lines with the opening bracket on the same line as the key. Therefore, we shouldn't enforce a split because of that.
    • Increase split penalty around exponent operator.
    • Correct spacing when using binary operators on strings with the NO_SPACES_AROUND_SELECTED_BINARY_OPERATORS option enabled.
  • v0.25.0 Changes

    November 25, 2018

    โž• Added

    • Added INDENT_BLANK_LINES knob to select whether the blank lines are empty or indented consistently with the current block.
    • ๐Ÿ‘Œ Support additional file exclude patterns in .yapfignore file. ### ๐Ÿ›  Fixed
    • Correctly determine if a scope is the last in line. It avoids a wrong computation of the line end when determining if it must split after the opening bracket with DEDENT_CLOSING_BRACKETS enabled.
  • v0.24.0 Changes

    September 07, 2018

    โž• Added

    • Added 'SPLIT_BEFORE_DOT' knob to support "builder style" calls. The "builder style" option didn't work as advertised. Lines would split after the dots, not before them regardless of the penalties. ### ๐Ÿ”„ Changed
    • Support Python 3.7 in the tests. The old "comp_for" and "comp_if" nodes are now "old_comp_for" and "old_comp_if" in lib2to3. ### ๐Ÿ›  Fixed
    • Don't count inner function calls when marking arguments as named assignments.
    • ๐Ÿ‘‰ Make sure that tuples and the like are formatted nicely if they all can't fit on a single line. This is similar to how we format function calls within an argument list.
    • ๐Ÿ‘ Allow splitting in a subscript if it goes over the line limit.
    • Increase the split penalty for an if-expression.
    • Increase penalty for splitting in a subscript so that it's more likely to split in a function call or other data literal.
    • Cloning a pytree node doesn't transfer its a annotations. Make sure we do that so that we don't lose information.
    • Revert change that broke the "no_spaces_around_binary_operators" option.
    • ๐Ÿ’… The "--style-help" option would output string lists and sets in Python types. If the output was used as a style, then it wouldn't parse those values correctly.
  • v0.23.0 Changes

    August 27, 2018

    โž• Added

    • DISABLE_ENDING_COMMA_HEURISTIC is a new knob to disable the heuristic which splits a list onto separate lines if the list is comma-terminated. ### ๐Ÿ›  Fixed
    • There's no need to increase N_TOKENS. In fact, it causes other things which use lib2to3 to fail if called from YAPF.
    • ๐Ÿ”„ Change the exception message instead of creating a new one that's just a clone.
    • ๐Ÿ‘‰ Make sure not to reformat when a line is disabled even if the --lines option is specified.
    • The "no spaces around operators" flag wasn't correctly converting strings to sets. Changed the regexp to handle it better.