# Change Log
# All notable changes to this project will be documented in this file.
# This project adheres to [Semantic Versioning](http://semver.org/).

## [0.14.0] UNRELEASED
#### Added
- formatting can be run in parallel using the "-p" / "--parallel" flags.
### Fixed
- "not in" and "is not" should be subtyped as binary operators.
- A non-Node dictionary value may have a comment before it. In those cases, we
  want to avoid encompassing only the comment in pseudo parens. So we include
  the actual value as well.
- Adjust calculation so that pseudo-parentheses don't count towards the total
  line length.
- Don't count a dictionary entry as not fitting on a single line in a
  dictionary.
- Don't count pseudo-parentheses in the length of the line.

## [0.13.2] 2016-10-22
### Fixed
- REGRESSION: A comment may have a prefix with newlines in it. When calculating
  the prefix indent, we cannot take the newlines into account. Otherwise, the
  comment will be misplaced causing the code to fail.

## [0.13.1] 2016-10-17
### Fixed
- Correct emitting a diff that was accidentally removed.

## [0.13.0] 2016-10-16
### Added
- Added support to retain the original line endings of the source code.

### Fixed
- Functions or classes with comments before them were reformatting the comments
  even if the code was supposed to be ignored by the formatter. We now don't
  adjust the whitespace before a function's comment if the comment is a
  "disabled" line. We also don't count "# yapf: {disable|enable}" as a disabled
  line, which seems logical.
- It's not really more readable to split before a dictionary value if it's part
  of a dictionary comprehension.
- Enforce two blank lines after a function or class definition, even before a
  comment. (But not between a decorator and a comment.) This is related to PEP8
  error E305.
- Remove O(n^2) algorithm from the line disabling logic.

## [0.12.2] 2016-10-09
### Fixed
- If `style.SetGlobalStyle(<create pre-defined style>)` was called and then
  `yapf_api.FormatCode` was called, the style set by the first call would be
  lost, because it would return the style created by `DEFAULT_STYLE_FACTORY`,
  which is set to PEP8 by default. Fix this by making the first call set which
  factory we call as the "default" style.
- Don't force a split before non-function call arguments.
- A dictionary being used as an argument to a function call and which can exist
  on a single line shouldn't be split.
- Don't rely upon the original line break to determine if we should split
  before the elements in a container. Especially split if there's a comment in
  the container.
- Don't add spaces between star and args in a lambda expression.
- If a nested data structure terminates in a comma, then split before the first
  element, but only if there's more than one element in the list.

## [0.12.1] 2016-10-02
### Changed
- Dictionary values will be placed on the same line as the key if *all* of the
  elements in the dictionary can be placed on one line. Otherwise, the
  dictionary values will be placed on the next line.

### Fixed
- Prefer to split before a terminating r-paren in an argument list if the line
  would otherwise go over the column limit.
- Split before the first key in a dictionary if the dictionary cannot fit on a
  single line.
- Don't count "pylint" comments when determining if the line goes over the
  column limit.
- Don't count the argument list of a lambda as a named assign in a function
  call.

## [0.12.0] 2016-09-25
### Added
- Support formatting of typed names. Typed names are formatted a similar way to
  how named arguments are formatted, except that there's a space after the
  colon.
- Add a knob, 'SPACES_AROUND_DEFAULT_OR_NAMED_ASSIGN', to allow adding spaces
  around the assign operator on default or named assigns.

## Changed
- Turn "verification" off by default for external APIs.
- If a function call in an argument list won't fit on the current line but will
  fit on a line by itself, then split before the call so that it won't be split
  up unnecessarily.

## Fixed
- Don't add space after power operator if the next operator's a unary operator.

## [0.11.1] 2016-08-17
### 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] 2016-07-17
### 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] 2016-06-14
### 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] 2016-05-29
### 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] 2016-05-21
### 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] 2016-05-18
### 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.

## [0.8.0] 2016-05-10
### 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] 2016-04-21
### 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] 2016-04-09
### 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] 2016-03-06
### Changed
- Documentation updated.

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

## [0.6.2] 2015-11-01
### 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] 2015-10-24
### 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 "dictonary 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.

## [0.6.0] 2015-10-18
### 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
  techincally 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] 2015-10-11
### 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] 2015-10-07
### 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] 2015-09-30
### Fixed
- Format closing scope bracket correctly when indentation size changes.

## [0.3.0] 2015-09-20
### 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] - 2015-09-13
### Fixed
- Formatting of multiple files. It was halting after formatting the first file.

## [0.2.8] - 2015-09-12
### Added
- Return a non-zero exit code if the source was changed.
- Add bitwise operator splitting penalty and prefer to split before bitwise
  operators.

### Fixed
- Retain vertical spacing between disabled and enabled lines.
- Split only at start of named assign.
- Retain comment position when formatting is disabled.
- Honor splitting before or after logical ops.
