blob: 4e7ff4eb1911d24517ce539190018b398d30b51e [file] [log] [blame]
Bill Wendlingdcafd5f2015-09-12 15:26:03 -07001# Change Log
2# All notable changes to this project will be documented in this file.
3# This project adheres to [Semantic Versioning](http://semver.org/).
4
Bill Wendlinga6988c32016-05-22 18:47:11 -07005## [0.9.0] UNRELEASED
6### Added
Bill Wendling1e161592016-05-23 16:34:03 -07007- Added a knob (SPLIT_PENALTY_BEFORE_IF_EXPR) to adjust the split penalty
8 before an if expression. This allows the user to place a list comprehension
9 all on one line.
10- Added a knob (SPLIT_BEFORE_FIRST_ARGUMENT) that encourages splitting before
11 the first element of a list of arguments or parameters if they are going to
12 be split anyway.
Bill Wendlinga6988c32016-05-22 18:47:11 -070013
Bill Wendling7edb3842016-05-21 15:07:54 -070014### Fixed
15- Don't split before a first element list argument as we would before a first
16 element function call.
Bill Wendlinge8a85692016-05-21 23:57:20 -070017- Don't penalize when we must split a line.
Bill Wendling283f4ea2016-05-23 16:19:15 -070018- Allow splitting before the single argument in a function call.
Bill Wendling7edb3842016-05-21 15:07:54 -070019
Bill Wendlingd2a585d2016-05-21 00:41:24 -070020## [0.8.2] 2016-05-21
Bill Wendling72cd2342016-05-19 01:28:58 -070021### Fixed
22- Prefer not to split after the opening of a subscript.
Bill Wendling1e179bb2016-05-19 01:51:34 -070023- Don't add space before the 'await' keyword if it's preceded by an opening
24 paren.
Bill Wendling4b6cead2016-05-19 11:33:38 -070025- When we're setting the split penalty for a continuous list, we don't want to
26 mistake a comment at the end of that list as part of the list.
Bill Wendlingda6ab272016-05-19 21:45:34 -070027- When calculating blank lines, don't assume the last seen object was a class
28 or function when we're in a class or function.
Bill Wendlingf61861d2016-05-21 00:36:27 -070029- Don't count the closing scope when determining if the current scope is the
30 last scope on the line.
Bill Wendling72cd2342016-05-19 01:28:58 -070031
Bill Wendlingde2c5b22016-05-18 21:10:29 -070032## [0.8.1] 2016-05-18
Bill Wendling8f1d1402016-05-14 19:22:48 -070033### Fixed
34- 'SPLIT_BEFORE_LOGICAL_OPERATOR' wasn't working correctly. The penalty was
35 being set incorrectly when it was part of a larger construct.
Bill Wendling99cbd562016-05-15 18:41:12 -070036- Don't separate a keyword, like "await", from a left paren.
Bill Wendling311c0872016-05-18 01:51:12 -070037- Don't rely upon the original tokens' line number to determine if we should
38 perform splitting in Facebook mode. The line number isn't the line number of
39 the reformatted token, but the line number where it was in the original code.
40 Instead, we need to carefully determine if the line is liabel to be split and
41 act accordingly.
Bill Wendling8f1d1402016-05-14 19:22:48 -070042
Bill Wendlingfe7a4ac2016-05-10 23:51:57 -070043## [0.8.0] 2016-05-10
Bill Wendling9dc79082016-05-10 00:23:53 -070044### Added
Bill Wendling43eaa752016-05-12 01:25:20 -070045- Add a knob, 'SPACES_AROUND_POWER_OPERATOR', to allow adding spaces around the
46 power operator.
Bill Wendling9dc79082016-05-10 00:23:53 -070047
Bill Wendlingf015a3c2016-04-21 20:14:24 -070048### Fixed
49- There shouldn't be a space between a decorator and an intervening comment.
Bill Wendling3e15d002016-04-28 00:16:32 -070050- If we split before a bitwise operator, then we assume that the programmer
51 knows what they're doing, more or less, and so we enforce a split before said
52 operator if one exists in the original program.
Bill Wendlingadf1d442016-05-10 01:03:50 -070053- Strengthen the bond between a keyword and value argument.
Bill Wendling93c42d92016-05-10 23:35:57 -070054- Don't add a blank line after a multiline string.
Bill Wendlingcae1edd2016-05-10 23:49:19 -070055- If the "for" part of a list comprehension can exist on the starting line
56 without going over the column limit, then let it remain there.
Bill Wendlingf015a3c2016-04-21 20:14:24 -070057
Bill Wendling8d36eb82016-04-21 02:33:36 -070058## [0.7.1] 2016-04-21
Bill Wendling4dc472d2016-04-10 03:03:55 -070059### Fixed
60- Don't rewrite the file if there are no changes.
Bill Wendlingac00a252016-04-12 05:31:03 -070061- Ensure the proper number of blank lines before an async function.
Bill Wendlingc4a49652016-04-13 13:42:43 -070062- Split after a bitwise operator when in PEP 8 mode.
Bill Wendling423759f2016-04-14 21:14:20 -070063- Retain the splitting within a dictionary data literal between the key and
64 value.
Bill Wendling9882f3d2016-04-21 02:29:35 -070065- Try to keep short function calls all on one line even if they're part of a
66 larger series of tokens. This stops us from splitting too much.
Bill Wendling4dc472d2016-04-10 03:03:55 -070067
Bill Wendlingdefe5f32016-04-09 22:29:51 -070068## [0.7.0] 2016-04-09
Bill Wendling2e588512016-03-13 01:02:47 -080069### Added
Bill Wendling5758e4d2016-03-19 03:38:48 -070070- Support for Python 3.5.
71- Add 'ALLOW_MULTILINE_LAMBDAS' which allows lambdas to be formatted onto
72 multiple lines.
Bill Wendling2e588512016-03-13 01:02:47 -080073
74### Fixed
75- Lessen penalty for splitting before a dictionary keyword.
Bill Wendling90a2aa52016-03-20 02:25:13 -070076- Formatting of trailing comments on disabled formatting lines.
Bill Wendling2064d882016-04-09 22:21:15 -070077- Disable / enable formatting at end of multi-line comment.
Bill Wendling2e588512016-03-13 01:02:47 -080078
Bill Wendling0bca2aa2016-03-06 20:44:14 -080079## [0.6.3] 2016-03-06
80### Changed
81- Documentation updated.
82
Bill Wendling95e47b92015-11-04 22:58:30 -080083### Fixed
84- Fix spacing of multiline comments when formatting is disabled.
85
Bill Wendling9ffd8152015-11-01 17:49:25 -080086## [0.6.2] 2015-11-01
Bill Wendling6e8ca7b2015-10-25 01:16:43 -070087### Changed
88- Look at the 'setup.cfg' file to see if it contains style information for
89 YAPF.
Bill Wendling169790e2015-10-25 03:13:13 -070090- Look at the '~/.config/yapf/style' file to see if it contains global style
91 information for YAPF.
Bill Wendling6e8ca7b2015-10-25 01:16:43 -070092
Bill Wendling57ffbbb2015-10-25 00:20:14 -070093### Fixed
94- Make lists that can fit on one line more likely to stay together.
Bill Wendling5091fa62015-10-28 01:51:53 -070095- Correct formatting of '*args' and '**kwargs' when there are default values in
96 the argument list.
Bill Wendling57ffbbb2015-10-25 00:20:14 -070097
Bill Wendling348b2f32015-10-24 03:20:10 -070098## [0.6.1] 2015-10-24
Bill Wendling3a3cb6d2015-10-20 13:40:27 -070099### Fixed
100- Make sure to align comments in data literals correctly. Also make sure we
101 don't count a "#." in a string as an i18n comment.
Bill Wendlinga6b57a62015-10-20 13:57:52 -0700102- Retain proper vertical spacing before comments in a data literal.
Bill Wendling843e48c2015-10-20 16:53:08 -0700103- Make sure that continuations from a compound statement are distinguished from
104 the succeeding line.
Bill Wendling81e37b62015-10-21 13:18:29 -0700105- Ignore preceding comments when calculating what is a "dictonary maker".
Bill Wendlinga5585722015-10-21 15:32:22 -0700106- Add a small penalty for splitting before a closing bracket.
Bill Wendlingdbcf3422015-10-21 22:11:15 -0700107- Ensure that a space is enforced after we remove a pseudo-paren that's between
108 two names, keywords, numbers, etc.
Bill Wendlingf8856722015-10-21 23:53:29 -0700109- Increase the penalty for splitting after a pseudo-paren. This could lead to
110 less readable code in some circumstances.
Bill Wendling3a3cb6d2015-10-20 13:40:27 -0700111
Bill Wendling7ef492b2015-10-18 14:43:06 -0700112## [0.6.0] 2015-10-18
Bill Wendlinga5cef8e2015-10-15 21:42:03 -0700113### Added
114- Add knob to indent the dictionary value if there is a split before it.
115
Bill Wendlingcec66962015-10-17 04:08:23 -0700116### Changed
117- No longer check that a file is a "Python" file unless the '--recursive' flag
118 is specified.
119- No longer allow the user to specify a directory unless the '--recursive' flag
120 is specified.
121
Bill Wendlingc87690c2015-10-11 16:45:21 -0700122### Fixed
123- When determining if we should split a dictionary's value to a new line, use
124 the longest entry instead of the total dictionary's length. This allows the
125 formatter to reformat the dictionary in a more consistent manner.
Bill Wendling0946c0f2015-10-12 00:42:30 -0700126- Improve how list comprehensions are formatted. Make splitting dependent upon
127 whether the "comp_for" or "comp_if" goes over the column limit.
Bill Wendling43bdc7b2015-10-12 14:25:30 -0700128- Don't over indent if expression hanging indents if we expect to dedent the
129 closing bracket.
Bill Wendlingc1052c62015-10-15 03:12:28 -0700130- Improve splitting heuristic when the first argument to a function call is
131 itself a function call with arguments. In cases like this, the remaining
132 arguments to the function call would look badly aligned, even though they are
133 techincally correct (the best kind of correct!).
Bill Wendlingb1037b52015-10-15 22:38:19 -0700134- Improve splitting heuristic more so that if the first argument to a function
135 call is a data literal that will go over the column limit, then we want to
136 split before it.
Bill Wendling8d8f5122015-10-16 11:46:23 -0700137- Remove spaces around '**' operator.
Bill Wendlingf8325e62015-10-16 15:38:54 -0700138- Retain formatting of comments in the middle of an expression.
Bill Wendling454cef62015-10-18 03:49:03 -0700139- Don't add a newline to an empty file.
Bill Wendling7ef492b2015-10-18 14:43:06 -0700140- Over indent a function's parameter list if it's not distinguished from the
141 body of the function.
Bill Wendlingc87690c2015-10-11 16:45:21 -0700142
Bill Wendling2aff7fc2015-10-11 14:08:10 -0700143## [0.5.0] 2015-10-11
Bill Wendlingd03c99f2015-10-08 21:06:07 -0700144### Added
145- Add option to exclude files/directories from formatting.
Bill Wendling5c608732015-10-10 23:39:16 -0700146- Add a knob to control whether import names are split after the first '('.
Bill Wendlingd03c99f2015-10-08 21:06:07 -0700147
Bill Wendlinga7e3f502015-10-08 00:23:40 -0700148### Fixed
149- Indent the continuation of an if-then statement when it's not distinguished
150 from the body of the if-then.
Bill Wendling1ce18c72015-10-10 23:12:16 -0700151- Allow for sensible splitting of array indices where appropriate.
Bill Wendlingbe974d82015-10-11 01:04:00 -0700152- Prefer to not split before the ending bracket of an atom. This produces
153 better code in most cases.
Bill Wendlingbbd148c2015-10-11 01:45:24 -0700154- Corrected how horizontal spaces were presevered in a disabled region.
Bill Wendlinga7e3f502015-10-08 00:23:40 -0700155
Bill Wendling967c3b22015-10-07 22:20:18 -0700156## [0.4.0] 2015-10-07
Ɓukasz Langa94089872015-09-22 16:02:26 -0700157### Added
158- Support for dedenting closing brackets, "facebook" style.
159
Bill Wendling25c8e602015-10-04 20:48:35 -0700160### Fixed
161- Formatting of tokens after a multiline string didn't retain their horizontal
162 spacing.
163
Bill Wendling06865ab2015-09-30 01:25:47 -0700164## [0.3.1] 2015-09-30
165### Fixed
166- Format closing scope bracket correctly when indentation size changes.
167
Bill Wendlinga690a622015-09-20 12:38:50 -0700168## [0.3.0] 2015-09-20
169### Added
170- Return a 2 if the source changed, 1 on error, and 0 for no change.
171
172### Fixed
173- Make sure we format if the "lines" specified are in the middle of a
174 statement.
175
Bill Wendling9adfa0c2015-09-13 05:37:30 -0700176## [0.2.9] - 2015-09-13
177### Fixed
178- Formatting of multiple files. It was halting after formatting the first file.
179
Bill Wendlingdcafd5f2015-09-12 15:26:03 -0700180## [0.2.8] - 2015-09-12
181### Added
182- Return a non-zero exit code if the source was changed.
183- Add bitwise operator splitting penalty and prefer to split before bitwise
184 operators.
185
186### Fixed
187- Retain vertical spacing between disabled and enabled lines.
188- Split only at start of named assign.
189- Retain comment position when formatting is disabled.
190- Honor splitting before or after logical ops.