yapf v0.31.0 Release Notes

Release Date: 2021-03-14 // 8 months ago
  • โž• 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 exlcuded directories. Prior versions would scan an exluded folder then exclude its contents on a file by file basis. Preventing the folder being scanned is faster. ### ๐Ÿ›  Fixed
    • ๐Ÿ Exclude directories on Windows.

Previous changes from v0.30.0

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