Yapf

Latest version: v0.40.2

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

Scan your dependencies

Page 8 of 10

0.8.0

Added
- Add a knob, 'SPACES_AROUND_POWER_OPERATOR', to allow adding spaces around the
power operator.

Fixed
- There shouldn't be a space between a decorator and an intervening comment.
- If we split before a bitwise operator, then we assume that the programmer
knows what they're doing, more or less, and so we enforce a split before said
operator if one exists in the original program.
- Strengthen the bond between a keyword and value argument.
- Don't add a blank line after a multiline string.
- If the "for" part of a list comprehension can exist on the starting line
without going over the column limit, then let it remain there.

0.7.1

Fixed
- Don't rewrite the file if there are no changes.
- Ensure the proper number of blank lines before an async function.
- Split after a bitwise operator when in PEP 8 mode.
- Retain the splitting within a dictionary data literal between the key and
value.
- Try to keep short function calls all on one line even if they're part of a
larger series of tokens. This stops us from splitting too much.

0.7.0

Added
- Support for Python 3.5.
- Add 'ALLOW_MULTILINE_LAMBDAS' which allows lambdas to be formatted onto
multiple lines.

Fixed
- Lessen penalty for splitting before a dictionary keyword.
- Formatting of trailing comments on disabled formatting lines.
- Disable / enable formatting at end of multi-line comment.

0.6.3

Changed
- Documentation updated.

Fixed
- Fix spacing of multiline comments when formatting is disabled.

0.6.2

Changed
- Look at the 'setup.cfg' file to see if it contains style information for
YAPF.
- Look at the '~/.config/yapf/style' file to see if it contains global style
information for YAPF.

Fixed
- Make lists that can fit on one line more likely to stay together.
- Correct formatting of '*args' and '**kwargs' when there are default values in
the argument list.

0.6.1

Fixed
- Make sure to align comments in data literals correctly. Also make sure we
don't count a "." in a string as an i18n comment.
- Retain proper vertical spacing before comments in a data literal.
- Make sure that continuations from a compound statement are distinguished from
the succeeding line.
- Ignore preceding comments when calculating what is a "dictionary maker".
- Add a small penalty for splitting before a closing bracket.
- Ensure that a space is enforced after we remove a pseudo-paren that's between
two names, keywords, numbers, etc.
- Increase the penalty for splitting after a pseudo-paren. This could lead to
less readable code in some circumstances.

Page 8 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.