Yapf

Latest version: v0.40.2

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

Scan your dependencies

Page 9 of 10

0.6.0

Added
- Add knob to indent the dictionary value if there is a split before it.

Changed
- No longer check that a file is a "Python" file unless the '--recursive' flag
is specified.
- No longer allow the user to specify a directory unless the '--recursive' flag
is specified.

Fixed
- When determining if we should split a dictionary's value to a new line, use
the longest entry instead of the total dictionary's length. This allows the
formatter to reformat the dictionary in a more consistent manner.
- Improve how list comprehensions are formatted. Make splitting dependent upon
whether the "comp_for" or "comp_if" goes over the column limit.
- Don't over indent if expression hanging indents if we expect to dedent the
closing bracket.
- Improve splitting heuristic when the first argument to a function call is
itself a function call with arguments. In cases like this, the remaining
arguments to the function call would look badly aligned, even though they are
technically correct (the best kind of correct!).
- Improve splitting heuristic more so that if the first argument to a function
call is a data literal that will go over the column limit, then we want to
split before it.
- Remove spaces around '**' operator.
- Retain formatting of comments in the middle of an expression.
- Don't add a newline to an empty file.
- Over indent a function's parameter list if it's not distinguished from the
body of the function.

0.5.0

Added
- Add option to exclude files/directories from formatting.
- Add a knob to control whether import names are split after the first '('.

Fixed
- Indent the continuation of an if-then statement when it's not distinguished
from the body of the if-then.
- Allow for sensible splitting of array indices where appropriate.
- Prefer to not split before the ending bracket of an atom. This produces
better code in most cases.
- Corrected how horizontal spaces were presevered in a disabled region.

0.4.0

Added
- Support for dedenting closing brackets, "facebook" style.

Fixed
- Formatting of tokens after a multiline string didn't retain their horizontal
spacing.

0.3.1

Fixed
- Format closing scope bracket correctly when indentation size changes.

0.3.0

Added
- Return a 2 if the source changed, 1 on error, and 0 for no change.

Fixed
- Make sure we format if the "lines" specified are in the middle of a
statement.

0.2.9

Fixed
- Formatting of multiple files. It was halting after formatting the first file.

Page 9 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.