Yapf

Latest version: v0.40.2

Safety actively analyzes 629564 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 10

0.11.1

Changed
- Issue 228: Return exit code 0 on success, regardless of whether files were
changed. (Previously, 0 meant success with no files
modified, and 2 meant success with at least one file modified.)

Fixed
- Enforce splitting each element in a dictionary if comma terminated.
- It's okay to split in the middle of a dotted name if the whole expression is
going to go over the column limit.
- Asynchronous functions were going missing if they were preceded by a comment
(a what? exactly). The asynchronous function processing wasn't taking the
comment into account and thus skipping the whole function.
- The splitting of arguments when comma terminated had a conflict. The split
penalty of the closing bracket was set to the maximum, but it shouldn't be if
the closing bracket is preceded by a comma.

0.11.0

Added
- The COALESCE_BRACKETS knob prevents splitting consecutive brackets when
DEDENT_CLOSING_BRACKETS is set.
- Don't count "pylint" directives as exceeding the column limit.

Changed
- We split all of the arguments to a function call if there's a named argument.
In this case, we want to split after the opening bracket too. This makes
things look a bit better.

Fixed
- When retaining format of a multiline string with Chromium style, make sure
that the multiline string doesn't mess up where the following comma ends up.
- Correct for when 'lib2to3' smooshes comments together into the same DEDENT
node.

0.10.0

Added
- Add a knob, 'USE_TABS', to allow using tabs for indentation.

Changed
- Performance enhancements.

Fixed
- Don't split an import list if it's not surrounded by parentheses.

0.9.0

Added
- Added a knob (SPLIT_PENALTY_BEFORE_IF_EXPR) to adjust the split penalty
before an if expression. This allows the user to place a list comprehension
all on one line.
- Added a knob (SPLIT_BEFORE_FIRST_ARGUMENT) that encourages splitting before
the first element of a list of arguments or parameters if they are going to
be split anyway.
- Added a knob (SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED) splits arguments to a
function if the list is terminated by a comma.

Fixed
- Don't split before a first element list argument as we would before a first
element function call.
- Don't penalize when we must split a line.
- Allow splitting before the single argument in a function call.

0.8.2

Fixed
- Prefer not to split after the opening of a subscript.
- Don't add space before the 'await' keyword if it's preceded by an opening
paren.
- When we're setting the split penalty for a continuous list, we don't want to
mistake a comment at the end of that list as part of the list.
- When calculating blank lines, don't assume the last seen object was a class
or function when we're in a class or function.
- Don't count the closing scope when determining if the current scope is the
last scope on the line.

0.8.1

Fixed
- 'SPLIT_BEFORE_LOGICAL_OPERATOR' wasn't working correctly. The penalty was
being set incorrectly when it was part of a larger construct.
- Don't separate a keyword, like "await", from a left paren.
- Don't rely upon the original tokens' line number to determine if we should
perform splitting in Facebook mode. The line number isn't the line number of
the reformatted token, but the line number where it was in the original code.
Instead, we need to carefully determine if the line is liabel to be split and
act accordingly.

Page 7 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.