Bill Wendling | dcafd5f | 2015-09-12 15:26:03 -0700 | [diff] [blame] | 1 | # 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 Wendling | 4aa43d8 | 2017-07-13 00:45:39 -0700 | [diff] [blame^] | 5 | ## [0.16.3] 2017-07-13 |
Bill Wendling | 81a6d84 | 2017-07-12 23:58:17 -0700 | [diff] [blame] | 6 | ### Changed |
| 7 | - Add filename information to a ParseError excetion. |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 8 | ### Fixed |
Bill Wendling | 4aa43d8 | 2017-07-13 00:45:39 -0700 | [diff] [blame^] | 9 | - A token that ends in a continuation marker may have more than one newline in |
| 10 | it, thus changing its "lineno" value. This can happen if multiple |
| 11 | continuation markers are used with no intervening tokens. Adjust the line |
| 12 | number to account for the lines covered by those markers. |
| 13 | - Make sure to split after a comment even for "pseudo" parentheses. |
| 14 | |
| 15 | ## [0.16.2] 2017-05-19 |
| 16 | ### Fixed |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 17 | - Treat expansion operators ('*', '**') in a similar way to function calls to |
| 18 | avoid splitting directly after the opening parenthesis. |
| 19 | - Increase the penalty for splitting after the start of a tuple. |
Bill Wendling | e67e353 | 2017-03-31 00:43:00 -0700 | [diff] [blame] | 20 | - Increase penalty for excess characters. |
Bill Wendling | 16becc5 | 2017-04-02 19:52:49 -0700 | [diff] [blame] | 21 | - Check that we have enough children before trying to access them all. |
Bill Wendling | da3697c | 2017-04-13 00:32:09 -0700 | [diff] [blame] | 22 | - Remove trailing whitespaces from comments. |
Bill Wendling | a36bb6d | 2017-04-16 18:51:53 -0700 | [diff] [blame] | 23 | - Split before a function call in a list if the full list isn't able to fit on |
| 24 | a single line. |
Bill Wendling | 1cfcbd1 | 2017-04-17 19:38:28 -0700 | [diff] [blame] | 25 | - Trying not to split around the '=' of a named assign. |
Bill Wendling | 81a6d84 | 2017-07-12 23:58:17 -0700 | [diff] [blame] | 26 | - Changed split before the first argument behavior to ignore compound |
| 27 | statements like if and while, but not function declarations. |
| 28 | - Changed coalesce brackets not to line split before closing bracket. |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 29 | |
Bill Wendling | 5ca3109 | 2017-03-22 11:41:07 -0700 | [diff] [blame] | 30 | ## [0.16.1] 2017-03-22 |
Bill Wendling | 5a1e331 | 2017-02-14 18:40:43 -0800 | [diff] [blame] | 31 | ### Changed |
| 32 | - Improved performance of cloning the format decision state object. This |
| 33 | improved the time in one *large* case from 273.485s to 234.652s. |
Bill Wendling | c2f520c | 2017-02-15 22:03:18 -0800 | [diff] [blame] | 34 | - Relax the requirement that a named argument needs to be on one line. Going |
| 35 | over the column limit is more of an issue to pylint than putting named args |
| 36 | on multiple lines. |
Bill Wendling | 79b82ef | 2017-02-17 00:24:51 -0800 | [diff] [blame] | 37 | - Don't make splitting penalty decisions based on the original formatting. This |
| 38 | can and does lead to non-stable formatting, where yapf will reformat the same |
| 39 | code in different ways. |
Bill Wendling | a952966 | 2017-02-06 21:47:39 -0800 | [diff] [blame] | 40 | ### Fixed |
| 41 | - Ensure splitting of arguments if there's a named assign present. |
Bill Wendling | 56f0fb6 | 2017-02-06 22:58:05 -0800 | [diff] [blame] | 42 | - Prefer to coalesce opening brackets if it's not at the beginning of a |
| 43 | function call. |
Bill Wendling | 313c65a | 2017-02-17 01:56:45 -0800 | [diff] [blame] | 44 | - Prefer not to squish all of the elements in a function call over to the |
| 45 | right-hand side. Split the arguments instead. |
Bill Wendling | 257c1b0 | 2017-02-20 15:32:29 -0800 | [diff] [blame] | 46 | - We need to split a dictionary value if the first element is a comment anyway, |
| 47 | so don't force the split here. It's forced elsewhere. |
CaselIT | d69801d | 2017-02-21 13:45:13 +0100 | [diff] [blame] | 48 | - Ensure tabs are used for continued indentation when USE_TABS is True. |
Bill Wendling | a952966 | 2017-02-06 21:47:39 -0800 | [diff] [blame] | 49 | |
Bill Wendling | 873039e | 2017-02-05 20:24:46 -0800 | [diff] [blame] | 50 | ## [0.16.0] 2017-02-05 |
Bill Wendling | 0e9b321 | 2017-01-31 14:41:00 -0800 | [diff] [blame] | 51 | ### Added |
| 52 | - The `EACH_DICT_ENTRY_ON_SEPARATE_LINE` knob indicates that each dictionary |
| 53 | entry should be in separate lines if the full dictionary isn't able to fit on |
| 54 | a single line. |
| 55 | - The `SPLIT_BEFORE_DICT_SET_GENERATOR` knob splits before the `for` part of a |
| 56 | dictionary/set generator. |
Bill Wendling | 9f49752 | 2017-02-04 04:39:47 -0800 | [diff] [blame] | 57 | - The `BLANK_LINE_BEFORE_CLASS_DOCSTRING` knob adds a blank line before a |
| 58 | class's docstring. |
Bill Wendling | 8d32136 | 2017-02-05 18:29:26 -0800 | [diff] [blame] | 59 | - The `ALLOW_MULTILINE_DICTIONARY_KEYS` knob allows dictionary keys to span |
| 60 | more than one line. |
Bill Wendling | 94962e5 | 2017-02-04 04:07:19 -0800 | [diff] [blame] | 61 | ### Fixed |
| 62 | - Split before all entries in a dict/set or list maker when comma-terminated, |
| 63 | even if there's only one entry. |
Adrian Tejn Kern | bfee67d | 2017-02-05 08:36:02 +0100 | [diff] [blame] | 64 | - Will now try to set O_BINARY mode on stdout under Windows and Python 2. |
| 65 | - Avoid unneeded newline transformation when writing formatted code to |
| 66 | output on (affects only Python 2) |
Bill Wendling | 0e9b321 | 2017-01-31 14:41:00 -0800 | [diff] [blame] | 67 | |
Bill Wendling | 3d470dd | 2017-01-29 19:45:13 -0800 | [diff] [blame] | 68 | ## [0.15.2] 2017-01-29 |
Bill Wendling | bf63118 | 2017-01-24 15:34:35 -0800 | [diff] [blame] | 69 | ### Fixed |
| 70 | - Don't perform a global split when a named assign is part of a function call |
| 71 | which itself is an argument to a function call. I.e., don't cause 'a' to |
| 72 | split here: |
| 73 | |
| 74 | func(a, b, c, d(x, y, z=42)) |
Bill Wendling | b64e702 | 2017-01-25 09:44:41 -0800 | [diff] [blame] | 75 | - Allow splitting inside a subscript if it's a logical or bitwise operating. |
| 76 | This should keep the subscript mostly contiguous otherwise. |
Bill Wendling | bf63118 | 2017-01-24 15:34:35 -0800 | [diff] [blame] | 77 | |
Bill Wendling | 5d7b361 | 2017-01-21 23:43:35 -0800 | [diff] [blame] | 78 | ## [0.15.1] 2017-01-21 |
Bill Wendling | 672ece0 | 2017-01-14 16:35:48 -0800 | [diff] [blame] | 79 | ### Fixed |
| 80 | - Don't insert a space between a type hint and the '=' sign. |
Bill Wendling | b57e71c | 2017-01-14 16:51:35 -0800 | [diff] [blame] | 81 | - The '@' operator can be used in Python 3 for matrix multiplication. Give the |
| 82 | '@' in the decorator a DECORATOR subtype to distinguish it. |
Bill Wendling | fd30b91 | 2017-01-15 16:45:24 -0800 | [diff] [blame] | 83 | - Encourage the formatter to split at the beginning of an argument list instead |
| 84 | of in the middle. Especially if the middle is an empty parameter list. This |
| 85 | adjusts the affinity of binary and comparison operators. In particular, the |
| 86 | "not in" and other such operators don't want to have a split after it (or |
| 87 | before it) if at all possible. |
Bill Wendling | 672ece0 | 2017-01-14 16:35:48 -0800 | [diff] [blame] | 88 | |
Bill Wendling | 61061f6 | 2017-01-12 20:58:55 -0800 | [diff] [blame] | 89 | ## [0.15.0] 2017-01-12 |
| 90 | ### Added |
| 91 | - Keep type annotations intact as much as possible. Don't try to split the over |
| 92 | mutliple lines. |
Bill Wendling | b50a6b2 | 2016-11-27 17:06:58 -0800 | [diff] [blame] | 93 | ### Fixed |
| 94 | - When determining if each element in a dictionary can fit on a single line, we |
| 95 | are skipping dictionary entries. However, we need to ignore comments in our |
| 96 | calculations and implicitly concatenated strings, which are already placed on |
| 97 | separate lines. |
Bill Wendling | 596300d | 2016-11-28 13:08:57 -0800 | [diff] [blame] | 98 | - Allow text before a "pylint" comment. |
Bill Wendling | eb979f3 | 2016-11-28 13:16:04 -0800 | [diff] [blame] | 99 | - Also allow text before a "yapf: (disable|enable)" comment. |
Bill Wendling | b50a6b2 | 2016-11-27 17:06:58 -0800 | [diff] [blame] | 100 | |
Bill Wendling | 544a281 | 2016-11-21 15:29:19 -0800 | [diff] [blame] | 101 | ## [0.14.0] 2016-11-21 |
Bill Wendling | 61061f6 | 2017-01-12 20:58:55 -0800 | [diff] [blame] | 102 | ### Added |
Diogo de Campos | 2f246c0 | 2016-10-06 14:04:38 +0200 | [diff] [blame] | 103 | - formatting can be run in parallel using the "-p" / "--parallel" flags. |
Bill Wendling | 6041f22 | 2016-11-02 01:07:39 -0700 | [diff] [blame] | 104 | ### Fixed |
| 105 | - "not in" and "is not" should be subtyped as binary operators. |
Bill Wendling | ccea10e | 2016-11-08 16:26:21 -0800 | [diff] [blame] | 106 | - A non-Node dictionary value may have a comment before it. In those cases, we |
| 107 | want to avoid encompassing only the comment in pseudo parens. So we include |
| 108 | the actual value as well. |
Bill Wendling | f728653 | 2016-11-16 17:52:50 -0800 | [diff] [blame] | 109 | - Adjust calculation so that pseudo-parentheses don't count towards the total |
| 110 | line length. |
Bill Wendling | 508694b | 2016-11-20 23:52:52 -0800 | [diff] [blame] | 111 | - Don't count a dictionary entry as not fitting on a single line in a |
| 112 | dictionary. |
Bill Wendling | 47c3e4f | 2016-11-21 15:25:09 -0800 | [diff] [blame] | 113 | - Don't count pseudo-parentheses in the length of the line. |
Bill Wendling | 6041f22 | 2016-11-02 01:07:39 -0700 | [diff] [blame] | 114 | |
Bill Wendling | 35d6b7c | 2016-10-22 01:18:51 -0700 | [diff] [blame] | 115 | ## [0.13.2] 2016-10-22 |
| 116 | ### Fixed |
| 117 | - REGRESSION: A comment may have a prefix with newlines in it. When calculating |
| 118 | the prefix indent, we cannot take the newlines into account. Otherwise, the |
| 119 | comment will be misplaced causing the code to fail. |
| 120 | |
Bill Wendling | f3e0965 | 2016-10-17 14:26:41 -0700 | [diff] [blame] | 121 | ## [0.13.1] 2016-10-17 |
| 122 | ### Fixed |
| 123 | - Correct emitting a diff that was accidentally removed. |
| 124 | |
Bill Wendling | 31f8213 | 2016-10-16 22:54:01 -0700 | [diff] [blame] | 125 | ## [0.13.0] 2016-10-16 |
Bill Wendling | cec6b19 | 2016-10-16 00:30:02 -0500 | [diff] [blame] | 126 | ### Added |
| 127 | - Added support to retain the original line endings of the source code. |
| 128 | |
Bill Wendling | a5a52e2 | 2016-10-11 13:40:38 -0700 | [diff] [blame] | 129 | ### Fixed |
| 130 | - Functions or classes with comments before them were reformatting the comments |
| 131 | even if the code was supposed to be ignored by the formatter. We now don't |
| 132 | adjust the whitespace before a function's comment if the comment is a |
| 133 | "disabled" line. We also don't count "# yapf: {disable|enable}" as a disabled |
| 134 | line, which seems logical. |
Bill Wendling | e6c9357 | 2016-10-11 20:26:23 -0700 | [diff] [blame] | 135 | - It's not really more readable to split before a dictionary value if it's part |
| 136 | of a dictionary comprehension. |
Bill Wendling | 556f915 | 2016-10-13 01:27:38 -0700 | [diff] [blame] | 137 | - Enforce two blank lines after a function or class definition, even before a |
Bill Wendling | 7cc4d18 | 2016-10-13 11:26:26 -0700 | [diff] [blame] | 138 | comment. (But not between a decorator and a comment.) This is related to PEP8 |
| 139 | error E305. |
Bill Wendling | 0d372eb | 2016-10-14 00:36:21 -0700 | [diff] [blame] | 140 | - Remove O(n^2) algorithm from the line disabling logic. |
Bill Wendling | a5a52e2 | 2016-10-11 13:40:38 -0700 | [diff] [blame] | 141 | |
Bill Wendling | c2620f9 | 2016-10-09 20:40:15 -0700 | [diff] [blame] | 142 | ## [0.12.2] 2016-10-09 |
Bill Wendling | 293cb6c | 2016-10-02 16:46:11 -0700 | [diff] [blame] | 143 | ### Fixed |
| 144 | - If `style.SetGlobalStyle(<create pre-defined style>)` was called and then |
| 145 | `yapf_api.FormatCode` was called, the style set by the first call would be |
| 146 | lost, because it would return the style created by `DEFAULT_STYLE_FACTORY`, |
| 147 | which is set to PEP8 by default. Fix this by making the first call set which |
| 148 | factory we call as the "default" style. |
Bill Wendling | 85b5a63 | 2016-10-03 20:30:43 -0700 | [diff] [blame] | 149 | - Don't force a split before non-function call arguments. |
Bill Wendling | 261c79a | 2016-10-03 20:58:08 -0700 | [diff] [blame] | 150 | - A dictionary being used as an argument to a function call and which can exist |
| 151 | on a single line shouldn't be split. |
Bill Wendling | 35edcbd | 2016-10-03 22:33:34 -0700 | [diff] [blame] | 152 | - Don't rely upon the original line break to determine if we should split |
Bill Wendling | c18abac | 2016-10-03 22:49:52 -0700 | [diff] [blame] | 153 | before the elements in a container. Especially split if there's a comment in |
| 154 | the container. |
Bill Wendling | 690132a | 2016-10-04 22:55:47 -0700 | [diff] [blame] | 155 | - Don't add spaces between star and args in a lambda expression. |
Bill Wendling | eef8fbd | 2016-10-05 00:34:25 -0700 | [diff] [blame] | 156 | - If a nested data structure terminates in a comma, then split before the first |
| 157 | element, but only if there's more than one element in the list. |
Bill Wendling | 293cb6c | 2016-10-02 16:46:11 -0700 | [diff] [blame] | 158 | |
| 159 | ## [0.12.1] 2016-10-02 |
Bill Wendling | 1960ffc | 2016-10-01 23:57:05 -0700 | [diff] [blame] | 160 | ### Changed |
| 161 | - Dictionary values will be placed on the same line as the key if *all* of the |
| 162 | elements in the dictionary can be placed on one line. Otherwise, the |
| 163 | dictionary values will be placed on the next line. |
| 164 | |
Bill Wendling | e041244 | 2016-09-28 02:19:31 -0700 | [diff] [blame] | 165 | ### Fixed |
| 166 | - Prefer to split before a terminating r-paren in an argument list if the line |
| 167 | would otherwise go over the column limit. |
Bill Wendling | 21836ef | 2016-09-28 19:13:16 -0700 | [diff] [blame] | 168 | - Split before the first key in a dictionary if the dictionary cannot fit on a |
| 169 | single line. |
Bill Wendling | 6199707 | 2016-09-30 00:45:59 -0700 | [diff] [blame] | 170 | - Don't count "pylint" comments when determining if the line goes over the |
| 171 | column limit. |
Bill Wendling | 0e70357 | 2016-10-01 23:02:32 -0700 | [diff] [blame] | 172 | - Don't count the argument list of a lambda as a named assign in a function |
| 173 | call. |
Bill Wendling | e041244 | 2016-09-28 02:19:31 -0700 | [diff] [blame] | 174 | |
Bill Wendling | 1b91963 | 2016-09-25 16:03:04 -0700 | [diff] [blame] | 175 | ## [0.12.0] 2016-09-25 |
Bill Wendling | 90eab55 | 2016-08-19 23:47:23 -0700 | [diff] [blame] | 176 | ### Added |
| 177 | - Support formatting of typed names. Typed names are formatted a similar way to |
| 178 | how named arguments are formatted, except that there's a space after the |
| 179 | colon. |
Alexander Lenz | 5fda36a | 2016-08-26 17:27:57 +0200 | [diff] [blame] | 180 | - Add a knob, 'SPACES_AROUND_DEFAULT_OR_NAMED_ASSIGN', to allow adding spaces |
| 181 | around the assign operator on default or named assigns. |
Bill Wendling | 90eab55 | 2016-08-19 23:47:23 -0700 | [diff] [blame] | 182 | |
Bill Wendling | 7c7f603 | 2016-08-31 10:46:33 -0700 | [diff] [blame] | 183 | ## Changed |
| 184 | - Turn "verification" off by default for external APIs. |
Bill Wendling | f0dd0a4 | 2016-09-25 15:54:02 -0700 | [diff] [blame] | 185 | - If a function call in an argument list won't fit on the current line but will |
| 186 | fit on a line by itself, then split before the call so that it won't be split |
| 187 | up unnecessarily. |
Bill Wendling | 7c7f603 | 2016-08-31 10:46:33 -0700 | [diff] [blame] | 188 | |
Bill Wendling | a6fb6f7 | 2016-09-17 14:39:26 -0700 | [diff] [blame] | 189 | ## Fixed |
| 190 | - Don't add space after power operator if the next operator's a unary operator. |
| 191 | |
Bill Wendling | 79ee44a | 2016-08-17 00:33:02 -0700 | [diff] [blame] | 192 | ## [0.11.1] 2016-08-17 |
Bill Wendling | 7b87b0a | 2016-08-17 00:01:56 -0700 | [diff] [blame] | 193 | ### Changed |
| 194 | - Issue #228: Return exit code 0 on success, regardless of whether files were |
| 195 | changed. (Previously, 0 meant success with no files |
| 196 | modified, and 2 meant success with at least one file modified.) |
| 197 | |
Bill Wendling | f4de4c6 | 2016-07-21 00:08:29 -0700 | [diff] [blame] | 198 | ### Fixed |
| 199 | - Enforce splitting each element in a dictionary if comma terminated. |
Bill Wendling | b8d20bd | 2016-08-05 23:44:23 -0700 | [diff] [blame] | 200 | - It's okay to split in the middle of a dotted name if the whole expression is |
| 201 | going to go over the column limit. |
Bill Wendling | 15edda2 | 2016-08-15 17:04:26 -0700 | [diff] [blame] | 202 | - Asynchronous functions were going missing if they were preceded by a comment |
| 203 | (a what? exactly). The asynchronous function processing wasn't taking the |
| 204 | comment into account and thus skipping the whole function. |
Bill Wendling | 7b87b0a | 2016-08-17 00:01:56 -0700 | [diff] [blame] | 205 | - The splitting of arguments when comma terminated had a conflict. The split |
| 206 | penalty of the closing bracket was set to the maximum, but it shouldn't be if |
| 207 | the closing bracket is preceded by a comma. |
Reece Hart | 039c0b5 | 2016-08-11 13:46:15 -0700 | [diff] [blame] | 208 | |
Bill Wendling | 1d8638e | 2016-07-17 00:06:01 -0700 | [diff] [blame] | 209 | ## [0.11.0] 2016-07-17 |
Ben Plotnick | 7e08829 | 2016-06-09 18:29:56 -0700 | [diff] [blame] | 210 | ### Added |
| 211 | - The COALESCE_BRACKETS knob prevents splitting consecutive brackets when |
| 212 | DEDENT_CLOSING_BRACKETS is set. |
Bill Wendling | 61e80c0 | 2016-07-14 16:50:10 -0700 | [diff] [blame] | 213 | - Don't count "pylint" directives as exceeding the column limit. |
Ben Plotnick | 7e08829 | 2016-06-09 18:29:56 -0700 | [diff] [blame] | 214 | |
Bill Wendling | 3363671 | 2016-07-16 02:49:28 -0700 | [diff] [blame] | 215 | ### Changed |
| 216 | - We split all of the arguments to a function call if there's a named argument. |
Bill Wendling | 2df2928 | 2016-07-16 17:23:41 -0700 | [diff] [blame] | 217 | In this case, we want to split after the opening bracket too. This makes |
Bill Wendling | 3363671 | 2016-07-16 02:49:28 -0700 | [diff] [blame] | 218 | things look a bit better. |
| 219 | |
Bill Wendling | 4761b18 | 2016-07-03 00:11:14 -0700 | [diff] [blame] | 220 | ### Fixed |
| 221 | - When retaining format of a multiline string with Chromium style, make sure |
| 222 | that the multiline string doesn't mess up where the following comma ends up. |
Bill Wendling | 821a36f | 2016-07-13 23:02:16 -0700 | [diff] [blame] | 223 | - Correct for when 'lib2to3' smooshes comments together into the same DEDENT |
| 224 | node. |
Bill Wendling | 4761b18 | 2016-07-03 00:11:14 -0700 | [diff] [blame] | 225 | |
Bill Wendling | 7521d4b | 2016-06-14 01:35:38 -0700 | [diff] [blame] | 226 | ## [0.10.0] 2016-06-14 |
Dracony | e582d63 | 2016-06-05 11:48:26 +0200 | [diff] [blame] | 227 | ### Added |
| 228 | - Add a knob, 'USE_TABS', to allow using tabs for indentation. |
Bill Wendling | 184c2de | 2016-06-13 03:21:04 -0700 | [diff] [blame] | 229 | |
Bill Wendling | b0285ba | 2016-05-31 16:10:59 -0700 | [diff] [blame] | 230 | ### Changed |
| 231 | - Performance enhancements. |
| 232 | |
Dracony | e582d63 | 2016-06-05 11:48:26 +0200 | [diff] [blame] | 233 | ### Fixed |
Bill Wendling | d02b592 | 2016-06-03 23:48:19 -0700 | [diff] [blame] | 234 | - Don't split an import list if it's not surrounded by parentheses. |
| 235 | |
Bill Wendling | 90f361f | 2016-05-29 16:13:10 -0700 | [diff] [blame] | 236 | ## [0.9.0] 2016-05-29 |
Bill Wendling | a6988c3 | 2016-05-22 18:47:11 -0700 | [diff] [blame] | 237 | ### Added |
Bill Wendling | 1e16159 | 2016-05-23 16:34:03 -0700 | [diff] [blame] | 238 | - Added a knob (SPLIT_PENALTY_BEFORE_IF_EXPR) to adjust the split penalty |
| 239 | before an if expression. This allows the user to place a list comprehension |
| 240 | all on one line. |
| 241 | - Added a knob (SPLIT_BEFORE_FIRST_ARGUMENT) that encourages splitting before |
| 242 | the first element of a list of arguments or parameters if they are going to |
| 243 | be split anyway. |
Bill Wendling | 86e5178 | 2016-05-24 00:47:44 -0700 | [diff] [blame] | 244 | - Added a knob (SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED) splits arguments to a |
| 245 | function if the list is terminated by a comma. |
Bill Wendling | a6988c3 | 2016-05-22 18:47:11 -0700 | [diff] [blame] | 246 | |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 247 | ### Fixed |
| 248 | - Don't split before a first element list argument as we would before a first |
| 249 | element function call. |
Bill Wendling | e8a8569 | 2016-05-21 23:57:20 -0700 | [diff] [blame] | 250 | - Don't penalize when we must split a line. |
Bill Wendling | 283f4ea | 2016-05-23 16:19:15 -0700 | [diff] [blame] | 251 | - Allow splitting before the single argument in a function call. |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 252 | |
Bill Wendling | d2a585d | 2016-05-21 00:41:24 -0700 | [diff] [blame] | 253 | ## [0.8.2] 2016-05-21 |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 254 | ### Fixed |
| 255 | - Prefer not to split after the opening of a subscript. |
Bill Wendling | 1e179bb | 2016-05-19 01:51:34 -0700 | [diff] [blame] | 256 | - Don't add space before the 'await' keyword if it's preceded by an opening |
| 257 | paren. |
Bill Wendling | 4b6cead | 2016-05-19 11:33:38 -0700 | [diff] [blame] | 258 | - When we're setting the split penalty for a continuous list, we don't want to |
| 259 | mistake a comment at the end of that list as part of the list. |
Bill Wendling | da6ab27 | 2016-05-19 21:45:34 -0700 | [diff] [blame] | 260 | - When calculating blank lines, don't assume the last seen object was a class |
| 261 | or function when we're in a class or function. |
Bill Wendling | f61861d | 2016-05-21 00:36:27 -0700 | [diff] [blame] | 262 | - Don't count the closing scope when determining if the current scope is the |
| 263 | last scope on the line. |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 264 | |
Bill Wendling | de2c5b2 | 2016-05-18 21:10:29 -0700 | [diff] [blame] | 265 | ## [0.8.1] 2016-05-18 |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 266 | ### Fixed |
| 267 | - 'SPLIT_BEFORE_LOGICAL_OPERATOR' wasn't working correctly. The penalty was |
| 268 | being set incorrectly when it was part of a larger construct. |
Bill Wendling | 99cbd56 | 2016-05-15 18:41:12 -0700 | [diff] [blame] | 269 | - Don't separate a keyword, like "await", from a left paren. |
Bill Wendling | 311c087 | 2016-05-18 01:51:12 -0700 | [diff] [blame] | 270 | - Don't rely upon the original tokens' line number to determine if we should |
| 271 | perform splitting in Facebook mode. The line number isn't the line number of |
| 272 | the reformatted token, but the line number where it was in the original code. |
| 273 | Instead, we need to carefully determine if the line is liabel to be split and |
| 274 | act accordingly. |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 275 | |
Bill Wendling | fe7a4ac | 2016-05-10 23:51:57 -0700 | [diff] [blame] | 276 | ## [0.8.0] 2016-05-10 |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 277 | ### Added |
Bill Wendling | 43eaa75 | 2016-05-12 01:25:20 -0700 | [diff] [blame] | 278 | - Add a knob, 'SPACES_AROUND_POWER_OPERATOR', to allow adding spaces around the |
| 279 | power operator. |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 280 | |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 281 | ### Fixed |
| 282 | - There shouldn't be a space between a decorator and an intervening comment. |
Bill Wendling | 3e15d00 | 2016-04-28 00:16:32 -0700 | [diff] [blame] | 283 | - If we split before a bitwise operator, then we assume that the programmer |
| 284 | knows what they're doing, more or less, and so we enforce a split before said |
| 285 | operator if one exists in the original program. |
Bill Wendling | adf1d44 | 2016-05-10 01:03:50 -0700 | [diff] [blame] | 286 | - Strengthen the bond between a keyword and value argument. |
Bill Wendling | 93c42d9 | 2016-05-10 23:35:57 -0700 | [diff] [blame] | 287 | - Don't add a blank line after a multiline string. |
Bill Wendling | cae1edd | 2016-05-10 23:49:19 -0700 | [diff] [blame] | 288 | - If the "for" part of a list comprehension can exist on the starting line |
| 289 | without going over the column limit, then let it remain there. |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 290 | |
Bill Wendling | 8d36eb8 | 2016-04-21 02:33:36 -0700 | [diff] [blame] | 291 | ## [0.7.1] 2016-04-21 |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 292 | ### Fixed |
| 293 | - Don't rewrite the file if there are no changes. |
Bill Wendling | ac00a25 | 2016-04-12 05:31:03 -0700 | [diff] [blame] | 294 | - Ensure the proper number of blank lines before an async function. |
Bill Wendling | c4a4965 | 2016-04-13 13:42:43 -0700 | [diff] [blame] | 295 | - Split after a bitwise operator when in PEP 8 mode. |
Bill Wendling | 423759f | 2016-04-14 21:14:20 -0700 | [diff] [blame] | 296 | - Retain the splitting within a dictionary data literal between the key and |
| 297 | value. |
Bill Wendling | 9882f3d | 2016-04-21 02:29:35 -0700 | [diff] [blame] | 298 | - Try to keep short function calls all on one line even if they're part of a |
| 299 | larger series of tokens. This stops us from splitting too much. |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 300 | |
Bill Wendling | defe5f3 | 2016-04-09 22:29:51 -0700 | [diff] [blame] | 301 | ## [0.7.0] 2016-04-09 |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 302 | ### Added |
Bill Wendling | 5758e4d | 2016-03-19 03:38:48 -0700 | [diff] [blame] | 303 | - Support for Python 3.5. |
| 304 | - Add 'ALLOW_MULTILINE_LAMBDAS' which allows lambdas to be formatted onto |
| 305 | multiple lines. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 306 | |
| 307 | ### Fixed |
| 308 | - Lessen penalty for splitting before a dictionary keyword. |
Bill Wendling | 90a2aa5 | 2016-03-20 02:25:13 -0700 | [diff] [blame] | 309 | - Formatting of trailing comments on disabled formatting lines. |
Bill Wendling | 2064d88 | 2016-04-09 22:21:15 -0700 | [diff] [blame] | 310 | - Disable / enable formatting at end of multi-line comment. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 311 | |
Bill Wendling | 0bca2aa | 2016-03-06 20:44:14 -0800 | [diff] [blame] | 312 | ## [0.6.3] 2016-03-06 |
| 313 | ### Changed |
| 314 | - Documentation updated. |
| 315 | |
Bill Wendling | 95e47b9 | 2015-11-04 22:58:30 -0800 | [diff] [blame] | 316 | ### Fixed |
| 317 | - Fix spacing of multiline comments when formatting is disabled. |
| 318 | |
Bill Wendling | 9ffd815 | 2015-11-01 17:49:25 -0800 | [diff] [blame] | 319 | ## [0.6.2] 2015-11-01 |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 320 | ### Changed |
| 321 | - Look at the 'setup.cfg' file to see if it contains style information for |
| 322 | YAPF. |
Bill Wendling | 169790e | 2015-10-25 03:13:13 -0700 | [diff] [blame] | 323 | - Look at the '~/.config/yapf/style' file to see if it contains global style |
| 324 | information for YAPF. |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 325 | |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 326 | ### Fixed |
| 327 | - Make lists that can fit on one line more likely to stay together. |
Bill Wendling | 5091fa6 | 2015-10-28 01:51:53 -0700 | [diff] [blame] | 328 | - Correct formatting of '*args' and '**kwargs' when there are default values in |
| 329 | the argument list. |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 330 | |
Bill Wendling | 348b2f3 | 2015-10-24 03:20:10 -0700 | [diff] [blame] | 331 | ## [0.6.1] 2015-10-24 |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 332 | ### Fixed |
| 333 | - Make sure to align comments in data literals correctly. Also make sure we |
| 334 | don't count a "#." in a string as an i18n comment. |
Bill Wendling | a6b57a6 | 2015-10-20 13:57:52 -0700 | [diff] [blame] | 335 | - Retain proper vertical spacing before comments in a data literal. |
Bill Wendling | 843e48c | 2015-10-20 16:53:08 -0700 | [diff] [blame] | 336 | - Make sure that continuations from a compound statement are distinguished from |
| 337 | the succeeding line. |
Bill Wendling | 81e37b6 | 2015-10-21 13:18:29 -0700 | [diff] [blame] | 338 | - Ignore preceding comments when calculating what is a "dictonary maker". |
Bill Wendling | a558572 | 2015-10-21 15:32:22 -0700 | [diff] [blame] | 339 | - Add a small penalty for splitting before a closing bracket. |
Bill Wendling | dbcf342 | 2015-10-21 22:11:15 -0700 | [diff] [blame] | 340 | - Ensure that a space is enforced after we remove a pseudo-paren that's between |
| 341 | two names, keywords, numbers, etc. |
Bill Wendling | f885672 | 2015-10-21 23:53:29 -0700 | [diff] [blame] | 342 | - Increase the penalty for splitting after a pseudo-paren. This could lead to |
| 343 | less readable code in some circumstances. |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 344 | |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 345 | ## [0.6.0] 2015-10-18 |
Bill Wendling | a5cef8e | 2015-10-15 21:42:03 -0700 | [diff] [blame] | 346 | ### Added |
| 347 | - Add knob to indent the dictionary value if there is a split before it. |
| 348 | |
Bill Wendling | cec6696 | 2015-10-17 04:08:23 -0700 | [diff] [blame] | 349 | ### Changed |
| 350 | - No longer check that a file is a "Python" file unless the '--recursive' flag |
| 351 | is specified. |
| 352 | - No longer allow the user to specify a directory unless the '--recursive' flag |
| 353 | is specified. |
| 354 | |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 355 | ### Fixed |
| 356 | - When determining if we should split a dictionary's value to a new line, use |
| 357 | the longest entry instead of the total dictionary's length. This allows the |
| 358 | formatter to reformat the dictionary in a more consistent manner. |
Bill Wendling | 0946c0f | 2015-10-12 00:42:30 -0700 | [diff] [blame] | 359 | - Improve how list comprehensions are formatted. Make splitting dependent upon |
| 360 | whether the "comp_for" or "comp_if" goes over the column limit. |
Bill Wendling | 43bdc7b | 2015-10-12 14:25:30 -0700 | [diff] [blame] | 361 | - Don't over indent if expression hanging indents if we expect to dedent the |
| 362 | closing bracket. |
Bill Wendling | c1052c6 | 2015-10-15 03:12:28 -0700 | [diff] [blame] | 363 | - Improve splitting heuristic when the first argument to a function call is |
| 364 | itself a function call with arguments. In cases like this, the remaining |
| 365 | arguments to the function call would look badly aligned, even though they are |
| 366 | techincally correct (the best kind of correct!). |
Bill Wendling | b1037b5 | 2015-10-15 22:38:19 -0700 | [diff] [blame] | 367 | - Improve splitting heuristic more so that if the first argument to a function |
| 368 | call is a data literal that will go over the column limit, then we want to |
| 369 | split before it. |
Bill Wendling | 8d8f512 | 2015-10-16 11:46:23 -0700 | [diff] [blame] | 370 | - Remove spaces around '**' operator. |
Bill Wendling | f8325e6 | 2015-10-16 15:38:54 -0700 | [diff] [blame] | 371 | - Retain formatting of comments in the middle of an expression. |
Bill Wendling | 454cef6 | 2015-10-18 03:49:03 -0700 | [diff] [blame] | 372 | - Don't add a newline to an empty file. |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 373 | - Over indent a function's parameter list if it's not distinguished from the |
| 374 | body of the function. |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 375 | |
Bill Wendling | 2aff7fc | 2015-10-11 14:08:10 -0700 | [diff] [blame] | 376 | ## [0.5.0] 2015-10-11 |
Bill Wendling | d03c99f | 2015-10-08 21:06:07 -0700 | [diff] [blame] | 377 | ### Added |
| 378 | - Add option to exclude files/directories from formatting. |
Bill Wendling | 5c60873 | 2015-10-10 23:39:16 -0700 | [diff] [blame] | 379 | - Add a knob to control whether import names are split after the first '('. |
Bill Wendling | d03c99f | 2015-10-08 21:06:07 -0700 | [diff] [blame] | 380 | |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 381 | ### Fixed |
| 382 | - Indent the continuation of an if-then statement when it's not distinguished |
| 383 | from the body of the if-then. |
Bill Wendling | 1ce18c7 | 2015-10-10 23:12:16 -0700 | [diff] [blame] | 384 | - Allow for sensible splitting of array indices where appropriate. |
Bill Wendling | be974d8 | 2015-10-11 01:04:00 -0700 | [diff] [blame] | 385 | - Prefer to not split before the ending bracket of an atom. This produces |
| 386 | better code in most cases. |
Bill Wendling | bbd148c | 2015-10-11 01:45:24 -0700 | [diff] [blame] | 387 | - Corrected how horizontal spaces were presevered in a disabled region. |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 388 | |
Bill Wendling | 967c3b2 | 2015-10-07 22:20:18 -0700 | [diff] [blame] | 389 | ## [0.4.0] 2015-10-07 |
Ćukasz Langa | 9408987 | 2015-09-22 16:02:26 -0700 | [diff] [blame] | 390 | ### Added |
| 391 | - Support for dedenting closing brackets, "facebook" style. |
| 392 | |
Bill Wendling | 25c8e60 | 2015-10-04 20:48:35 -0700 | [diff] [blame] | 393 | ### Fixed |
| 394 | - Formatting of tokens after a multiline string didn't retain their horizontal |
| 395 | spacing. |
| 396 | |
Bill Wendling | 06865ab | 2015-09-30 01:25:47 -0700 | [diff] [blame] | 397 | ## [0.3.1] 2015-09-30 |
| 398 | ### Fixed |
| 399 | - Format closing scope bracket correctly when indentation size changes. |
| 400 | |
Bill Wendling | a690a62 | 2015-09-20 12:38:50 -0700 | [diff] [blame] | 401 | ## [0.3.0] 2015-09-20 |
| 402 | ### Added |
| 403 | - Return a 2 if the source changed, 1 on error, and 0 for no change. |
| 404 | |
| 405 | ### Fixed |
| 406 | - Make sure we format if the "lines" specified are in the middle of a |
| 407 | statement. |
| 408 | |
Bill Wendling | 9adfa0c | 2015-09-13 05:37:30 -0700 | [diff] [blame] | 409 | ## [0.2.9] - 2015-09-13 |
| 410 | ### Fixed |
| 411 | - Formatting of multiple files. It was halting after formatting the first file. |
| 412 | |
Bill Wendling | dcafd5f | 2015-09-12 15:26:03 -0700 | [diff] [blame] | 413 | ## [0.2.8] - 2015-09-12 |
| 414 | ### Added |
| 415 | - Return a non-zero exit code if the source was changed. |
| 416 | - Add bitwise operator splitting penalty and prefer to split before bitwise |
| 417 | operators. |
| 418 | |
| 419 | ### Fixed |
| 420 | - Retain vertical spacing between disabled and enabled lines. |
| 421 | - Split only at start of named assign. |
| 422 | - Retain comment position when formatting is disabled. |
| 423 | - Honor splitting before or after logical ops. |