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 | e58b7c4 | 2023-06-13 02:37:41 -0500 | [diff] [blame] | 5 | ## [0.40.0] 2023-06-13 |
Sebastian Pipping | 8358264 | 2023-05-02 21:55:49 +0200 | [diff] [blame] | 6 | ### Added |
| 7 | - Support for Python 3.11 |
Eugene Toder | e29a9b0 | 2023-05-23 15:19:49 -0400 | [diff] [blame] | 8 | - Add the `--print-modified` flag to print out file names of modified files when |
| 9 | running in in-place mode. |
Bill Wendling | 85bd59b | 2023-06-10 01:06:29 -0500 | [diff] [blame] | 10 | ### Changes |
| 11 | - Replace the outdated and no-longer-supported lib2to3 with a fork of blib2to3, |
| 12 | Black's version of lib2to3. |
Sebastian Pipping | 8358264 | 2023-05-02 21:55:49 +0200 | [diff] [blame] | 13 | ### Removed |
Bill Wendling | e58b7c4 | 2023-06-13 02:37:41 -0500 | [diff] [blame] | 14 | - Support for Python versions < 3.7 are no longer supported. |
Sebastian Pipping | 8358264 | 2023-05-02 21:55:49 +0200 | [diff] [blame] | 15 | |
Bill Wendling | 02c6bf0 | 2023-04-18 21:01:02 +0000 | [diff] [blame] | 16 | ## [0.33.0] 2023-04-18 |
Bill Wendling | 516e197 | 2021-12-25 02:21:06 -0600 | [diff] [blame] | 17 | ### Added |
| 18 | - Add a new Python parser to generate logical lines. |
Yilei "Dolee" Yang | e097907 | 2022-09-23 10:44:06 -0700 | [diff] [blame] | 19 | - Added support for `# fmt: on` and `# fmt: off` pragmas. |
Bill Wendling | 831fb3d | 2021-12-27 13:04:22 -0800 | [diff] [blame] | 20 | ### Changes |
| 21 | - Moved 'pytree' parsing tools into its own subdirectory. |
Hugo van Kemenade | e02dfd1 | 2022-01-02 03:54:34 +0200 | [diff] [blame] | 22 | - Add support for Python 3.10. |
Alexey Pelykh | bb2baba | 2023-01-04 06:26:36 +0100 | [diff] [blame] | 23 | - Format generated dicts with respect to same rules as regular dicts |
Sergei Lebedev | b41eb9c | 2022-02-21 21:49:06 +0000 | [diff] [blame] | 24 | - Generalized the ending comma heuristic to subscripts. |
Bill Wendling | 02c6bf0 | 2023-04-18 21:01:02 +0000 | [diff] [blame] | 25 | - Supports "pyproject.toml" by default. |
Nuri Jung | 3684f3c | 2022-01-12 04:25:35 +0900 | [diff] [blame] | 26 | ### Fixed |
| 27 | - Split line before all comparison operators. |
Bill Wendling | 831fb3d | 2021-12-27 13:04:22 -0800 | [diff] [blame] | 28 | |
Bill Wendling | d3873c0 | 2021-12-26 00:49:04 -0600 | [diff] [blame] | 29 | ## [0.32.0] 2021-12-26 |
hirosassa | f16340e | 2021-07-13 10:00:32 +0900 | [diff] [blame] | 30 | ### Added |
| 31 | - Look at the 'pyproject.toml' file to see if it contains ignore file information |
| 32 | for YAPF. |
Sergei Lebedev | 6471e0a | 2021-09-02 17:49:34 +0000 | [diff] [blame] | 33 | - New entry point `yapf_api.FormatTree` for formatting lib2to3 concrete |
| 34 | syntax trees. |
Bill Wendling | 5142e58 | 2021-11-04 03:39:00 -0700 | [diff] [blame] | 35 | - Add CI via GitHub Actions. |
Bill Wendling | 8ec4ed6 | 2021-11-04 03:09:01 -0700 | [diff] [blame] | 36 | ### Changes |
| 37 | - Change tests to support "pytest". |
Bill Wendling | 7d16a18 | 2021-11-04 03:32:37 -0700 | [diff] [blame] | 38 | - Reformat so that "flake8" is happy. |
Bill Wendling | 82ebfca | 2021-11-04 04:11:03 -0700 | [diff] [blame] | 39 | - Use GitHub Actions instead of Travis for CI. |
Bill Wendling | e9dd4e5 | 2021-11-08 01:36:48 -0800 | [diff] [blame] | 40 | - Clean up the FormatToken interface to limit how much it relies upon the |
| 41 | pytree node object. |
Bill Wendling | 5b75e6f | 2021-12-25 22:31:14 -0600 | [diff] [blame] | 42 | - Rename "unwrapped_line" module to "logical_line." |
| 43 | - Rename "UnwrappedLine" class to "LogicalLine." |
Bouwe Andela | 5fda04e | 2021-08-23 21:38:15 +0200 | [diff] [blame] | 44 | ### Fixed |
Mauricio Herrera Cuadra | fb0fbb4 | 2022-02-08 11:27:53 -0800 | [diff] [blame] | 45 | - Added pyproject extra to install toml package as an optional dependency. |
Bouwe Andela | 5fda04e | 2021-08-23 21:38:15 +0200 | [diff] [blame] | 46 | - Enable `BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF` knob for "pep8" style, so |
| 47 | method definitions inside a class are surrounded by a single blank line as |
| 48 | prescribed by PEP8. |
Bill Wendling | dbd49c3 | 2021-11-03 02:46:33 -0700 | [diff] [blame] | 49 | - Fixed the '...' token to be spaced after a colon. |
hirosassa | f16340e | 2021-07-13 10:00:32 +0900 | [diff] [blame] | 50 | |
Bill Wendling | c607795 | 2021-03-12 13:42:14 -0800 | [diff] [blame] | 51 | ## [0.31.0] 2021-03-14 |
Mauricio Herrera Cuadra | 37924d4 | 2020-08-19 20:41:56 -0700 | [diff] [blame] | 52 | ### Added |
Bill Wendling | 85bd59b | 2023-06-10 01:06:29 -0500 | [diff] [blame] | 53 | - Renamed 'master' branch to 'main'. |
Mauricio Herrera Cuadra | 37924d4 | 2020-08-19 20:41:56 -0700 | [diff] [blame] | 54 | - Add 'BLANK_LINES_BETWEEN_TOP_LEVEL_IMPORTS_AND_VARIABLES' to support setting |
| 55 | a custom number of blank lines between top-level imports and variable |
| 56 | definitions. |
Gregory P. Smith | c4ce158 | 2020-12-20 17:58:11 -0800 | [diff] [blame] | 57 | - Ignore end of line `# copybara:` directives when checking line length. |
hirosassa | 664e7c0 | 2021-03-13 06:31:58 +0900 | [diff] [blame] | 58 | - Look at the 'pyproject.toml' file to see if it contains style information for |
| 59 | YAPF. |
Brénainn Woodsend | a53e340 | 2021-02-05 20:54:31 +0000 | [diff] [blame] | 60 | ### Changed |
Christian Clauss | 633744e | 2021-09-16 20:04:21 +0200 | [diff] [blame] | 61 | - Do not scan excluded directories. Prior versions would scan an excluded |
Brénainn Woodsend | a53e340 | 2021-02-05 20:54:31 +0000 | [diff] [blame] | 62 | folder then exclude its contents on a file by file basis. Preventing the |
| 63 | folder being scanned is faster. |
Brénainn Woodsend | 6abab7f | 2020-12-02 19:53:38 +0000 | [diff] [blame] | 64 | ### Fixed |
| 65 | - Exclude directories on Windows. |
Mauricio Herrera Cuadra | 37924d4 | 2020-08-19 20:41:56 -0700 | [diff] [blame] | 66 | |
Bill Wendling | 51ffe2d | 2020-04-23 12:05:40 -0700 | [diff] [blame] | 67 | ## [0.30.0] 2020-04-23 |
David Brownell | 86a12d6 | 2020-04-23 10:47:13 -0700 | [diff] [blame] | 68 | ### Added |
| 69 | - Added `SPACES_AROUND_LIST_DELIMITERS`, `SPACES_AROUND_DICT_DELIMITERS`, |
| 70 | and `SPACES_AROUND_TUPLE_DELIMITERS` to add spaces after the opening- |
| 71 | and before the closing-delimiters for lists, dicts, and tuples. |
| 72 | - Adds `FORCE_MULTILINE_DICT` knob to ensure dictionaries always split, |
| 73 | even when shorter than the max line length. |
| 74 | - New knob `SPACE_INSIDE_BRACKETS` to add spaces inside brackets, braces, and |
| 75 | parentheses. |
| 76 | - New knob `SPACES_AROUND_SUBSCRIPT_COLON` to add spaces around the subscript / |
| 77 | slice operator. |
agrieve | 22ef70f | 2020-04-23 14:23:20 -0400 | [diff] [blame] | 78 | ### Changed |
| 79 | - Renamed "chromium" style to "yapf". Chromium will now use PEP-8 directly. |
Yinyin | f967fd6 | 2020-04-24 02:27:42 +0800 | [diff] [blame] | 80 | - `CONTINUATION_ALIGN_STYLE` with `FIXED` or `VALIGN-RIGHT` now works with |
| 81 | space indentation. |
Bill Wendling | c4257ed | 2020-01-14 14:04:09 -0800 | [diff] [blame] | 82 | ### Fixed |
| 83 | - Honor a disable directive at the end of a multiline comment. |
Bill Wendling | 8d184be | 2020-01-21 11:35:43 -0800 | [diff] [blame] | 84 | - Don't require splitting before comments in a list when |
| 85 | `SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES` is set. The knob is meant for |
| 86 | values, not comments, which may be associated with the current line. |
Bill Wendling | 2bd2b22 | 2020-01-22 03:50:25 -0800 | [diff] [blame] | 87 | - Don't over-indent a parameter list when not needed. But make sure it is |
| 88 | properly indented so that it doesn't collide with the lines afterwards. |
Bill Wendling | f752a01 | 2020-02-03 16:57:15 -0800 | [diff] [blame] | 89 | - Don't split between two-word comparison operators: "is not", "not in", etc. |
Bill Wendling | c4257ed | 2020-01-14 14:04:09 -0800 | [diff] [blame] | 90 | |
Bill Wendling | ee4c28e | 2019-11-28 01:56:01 -0800 | [diff] [blame] | 91 | ## [0.29.0] 2019-11-28 |
Bill Wendling | 419a001 | 2019-08-06 01:04:46 -0700 | [diff] [blame] | 92 | ### Added |
| 93 | - Add the `--quiet` flag to suppress output. The return code is 1 if there are |
| 94 | changes, similarly to the `--diff` flag. |
Ethan Furman | 4624511 | 2019-11-14 13:45:12 -0800 | [diff] [blame] | 95 | - Add the `indent_closing_brackets` option. This is the same as the |
| 96 | `dedent_closing_brackets` option except the brackets are indented the same |
| 97 | as the previous line. |
Bill Wendling | bf54d8c | 2019-07-11 22:25:51 -0700 | [diff] [blame] | 98 | ### Changed |
| 99 | - Collect a parameter list into a single object. This allows us to track how a |
| 100 | parameter list is formatted, keeping state along the way. This helps when |
| 101 | supporting Python 3 type annotations. |
Bill Wendling | 419a001 | 2019-08-06 01:04:46 -0700 | [diff] [blame] | 102 | - Catch and report `UnicodeDecodeError` exceptions. |
Bill Wendling | be634cd | 2019-11-27 18:05:28 -0800 | [diff] [blame] | 103 | - Improved description of .yapfignore syntax. |
Bill Wendling | b4acb6f | 2019-07-11 23:46:15 -0700 | [diff] [blame] | 104 | ### Fixed |
| 105 | - Format subscript lists so that splits are essentially free after a comma. |
Bill Wendling | 0c58cf7 | 2019-07-16 01:28:38 -0700 | [diff] [blame] | 106 | - Don't add a space between a string and its subscript. |
Eric An | ec31141 | 2019-07-19 08:41:25 -0700 | [diff] [blame] | 107 | - Extend discovery of '.style.yapf' & 'setup.cfg' files to search the root |
| 108 | directory as well. |
Bill Wendling | 3498e3f | 2019-07-20 14:22:20 -0700 | [diff] [blame] | 109 | - Make sure we have parameters before we start calculating penalties for |
| 110 | splitting them. |
Bill Wendling | 126fc7e | 2019-08-13 14:28:22 -0700 | [diff] [blame] | 111 | - Indicate if a class/function is nested to ensure blank lines when needed. |
Väinö Järvelä | 24c1ac0 | 2019-11-14 06:39:52 +0200 | [diff] [blame] | 112 | - Fix extra indentation in async-for else statement. |
Bill Wendling | 0565b69 | 2019-11-23 15:18:12 -0800 | [diff] [blame] | 113 | - A parameter list with no elements shouldn't count as exceeding the column |
| 114 | limit. |
Bill Wendling | 405a524 | 2019-11-27 16:25:40 -0800 | [diff] [blame] | 115 | - When splitting all comma separated values, don't treat the ending bracket as |
| 116 | special. |
Bill Wendling | 505a59f | 2019-11-27 16:56:38 -0800 | [diff] [blame] | 117 | - The "no blank lines between nested classes or functions" knob should only |
| 118 | apply to the first nested class or function, not all of them. |
Bill Wendling | bf54d8c | 2019-07-11 22:25:51 -0700 | [diff] [blame] | 119 | |
Bill Wendling | 58458f9 | 2019-07-11 22:07:39 -0700 | [diff] [blame] | 120 | ## [0.28.0] 2019-07-11 |
Sergio Giro | d2814d8 | 2019-04-24 09:49:49 +0100 | [diff] [blame] | 121 | ### Added |
| 122 | - New knob `SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES` is a variation on |
Bill Wendling | a47ca73 | 2019-04-24 02:01:17 -0700 | [diff] [blame] | 123 | `SPLIT_ALL_COMMA_SEPARATED_VALUES` in which, if a subexpression with a comma |
Sergio Giro | d2814d8 | 2019-04-24 09:49:49 +0100 | [diff] [blame] | 124 | fits in its starting line, then the subexpression is not split (thus avoiding |
| 125 | unnecessary splits). |
Brian Quinlan | b3e33c3 | 2019-04-08 14:06:53 -0700 | [diff] [blame] | 126 | ### Changed |
| 127 | - Set `INDENT_DICTIONARY_VALUE` for Google style. |
Gary Miguel | 1d9db2a | 2019-07-10 15:12:07 -0700 | [diff] [blame] | 128 | - Set `JOIN_MULTIPLE_LINES = False` for Google style. |
Bill Wendling | ba85e7c | 2019-04-09 03:00:56 -0700 | [diff] [blame] | 129 | ### Fixed |
| 130 | - `BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=False` wasn't honored because the |
| 131 | number of newlines was erroneously calculated beforehand. |
Bill Wendling | f42b489 | 2019-06-21 11:44:32 -0700 | [diff] [blame] | 132 | - Lambda expressions shouldn't have an increased split penalty applied to the |
| 133 | 'lambda' keyword. This prevents them from being properly formatted when they're |
| 134 | arguments to functions. |
Bill Wendling | be4be44 | 2019-06-21 12:56:22 -0700 | [diff] [blame] | 135 | - A comment with continuation markers (??) shouldn't mess with the lineno count. |
Bill Wendling | c28f999 | 2019-06-27 10:31:34 -0700 | [diff] [blame] | 136 | - Only emit unformatted if the "disable long line" is at the end of the line. |
| 137 | Otherwise we could mess up formatting for containers which have them |
| 138 | interspersed with code. |
Bill Wendling | 4b08781 | 2019-07-01 15:16:05 -0700 | [diff] [blame] | 139 | - Fix a potential race condition by using the correct style for opening a file |
| 140 | which may not exist. |
Brian Quinlan | b3e33c3 | 2019-04-08 14:06:53 -0700 | [diff] [blame] | 141 | |
Bill Wendling | a1e69ad | 2019-04-07 03:44:52 -0700 | [diff] [blame] | 142 | ## [0.27.0] 2019-04-07 |
Bill Wendling | 7903f38 | 2019-02-10 02:48:32 -0800 | [diff] [blame] | 143 | ### Added |
| 144 | - `SPLIT_BEFORE_ARITHMETIC_OPERATOR` splits before an arithmetic operator when |
| 145 | set. `SPLIT_PENALTY_ARITHMETIC_OPERATOR` allows you to set the split penalty |
| 146 | around arithmetic operators. |
Bill Wendling | 4787f23 | 2019-04-07 01:43:39 -0700 | [diff] [blame] | 147 | ### Changed |
| 148 | - Catch lib2to3's "TokenError" exception and output a nicer message. |
Bill Wendling | a4d0b6d | 2019-02-09 06:01:29 -0800 | [diff] [blame] | 149 | ### Fixed |
| 150 | - Parse integer lists correctly, removing quotes if the list is within a |
| 151 | string. |
Bill Wendling | e2ce893 | 2019-02-10 02:06:37 -0800 | [diff] [blame] | 152 | - Adjust the penalties of bitwise operands for '&' and '^', similar to '|'. |
Alessandro Pietro Bardelli | a017b73 | 2019-03-12 17:19:27 +0100 | [diff] [blame] | 153 | - Avoid splitting after opening parens if SPLIT_BEFORE_FIRST_ARGUMENT is set |
| 154 | to False. |
| 155 | - Adjust default SPLIT_PENALTY_AFTER_OPENING_BRACKET. |
Kevin Cox | fb0220e | 2019-03-14 14:18:34 +0000 | [diff] [blame] | 156 | - Re-enable removal of extra lines on the boundaries of formatted regions. |
Bill Wendling | 07a7d59 | 2019-03-26 17:07:58 -0700 | [diff] [blame] | 157 | - Adjust list splitting to avoid splitting before a dictionary element, because |
| 158 | those are likely to be split anyway. If we do split, it leads to horrible |
| 159 | looking code. |
Bill Wendling | 14ae919 | 2019-04-07 02:15:26 -0700 | [diff] [blame] | 160 | - Dictionary arguments were broken in a recent version. It resulted in |
| 161 | unreadable formatting, where the remaining arguments were indented far more |
| 162 | than the dictionary. Fixed so that if the dictionary is the first argument in |
| 163 | a function call and doesn't fit on a single line, then it forces a split. |
Bill Wendling | 726dce1 | 2019-04-07 02:48:45 -0700 | [diff] [blame] | 164 | - Improve the connectiveness between items in a list. This prevents random |
| 165 | splitting when it's not 100% necessary. |
Bill Wendling | a293e92 | 2019-04-07 03:41:17 -0700 | [diff] [blame] | 166 | - Don't remove a comment attached to a previous object just because it's part |
| 167 | of the "prefix" of a function/class node. |
Bill Wendling | a4d0b6d | 2019-02-09 06:01:29 -0800 | [diff] [blame] | 168 | |
Bill Wendling | 37f675d | 2019-02-08 23:07:28 -0800 | [diff] [blame] | 169 | ## [0.26.0] 2019-02-08 |
Bill Wendling | ceed6ab | 2018-12-04 19:40:12 -0800 | [diff] [blame] | 170 | ### Added |
| 171 | - `ALLOW_SPLIT_BEFORE_DEFAULT_OR_NAMED_ASSIGNS` allows us to split before |
| 172 | default / named assignments. |
Harald Husum | 4f21ba6 | 2019-02-08 11:15:17 +0100 | [diff] [blame] | 173 | - `ARITHMETIC_PRECEDENCE_INDICATION` removes spacing around binary operators |
| 174 | if they have higher precedence than other operators in the same expression. |
David Brownell | 7703a4e | 2018-12-02 10:03:24 -0800 | [diff] [blame] | 175 | ### Changed |
| 176 | - `SPACES_BEFORE_COMMENT` can now be assigned to a specific value (standard |
Alessandro Pietro Bardelli | a017b73 | 2019-03-12 17:19:27 +0100 | [diff] [blame] | 177 | behavior) or a list of column values. When assigned to a list, trailing |
David Brownell | 7703a4e | 2018-12-02 10:03:24 -0800 | [diff] [blame] | 178 | comments will be horizontally aligned to the first column value within |
| 179 | the list that is greater than the maximum line length in the block. |
Bill Wendling | 00af74e | 2018-12-04 19:14:10 -0800 | [diff] [blame] | 180 | - Don't modify the vertical spacing of a line that has a comment "pylint: |
| 181 | disable=line-too-long". The line is expected to be too long. |
Yinyin L | 5314aeb | 2019-01-20 01:36:57 +0800 | [diff] [blame] | 182 | - improved `CONTINUATION_ALIGN_STYLE` to accept quoted or underline-separated |
| 183 | option value for passing option with command line arguments. |
Bill Wendling | 225ad43 | 2018-11-27 23:57:42 -0800 | [diff] [blame] | 184 | ### Fixed |
| 185 | - When retrieving the opening bracket make sure that it's actually an opening |
| 186 | bracket. |
Bill Wendling | 480143c | 2018-11-28 00:50:16 -0800 | [diff] [blame] | 187 | - Don't completely deny a lambda formatting if it goes over the column limit. |
| 188 | Split only if absolutely necessary. |
Bill Wendling | 30dbe32 | 2018-11-28 01:04:08 -0800 | [diff] [blame] | 189 | - Bump up penalty for splitting before a dot ('.'). |
Bill Wendling | 84a3d9d | 2018-12-04 16:35:24 -0800 | [diff] [blame] | 190 | - Ignore pseudo tokens when calculating split penalties. |
| 191 | - Increase the penalty for splitting before the first bit of a subscript. |
Bill Wendling | f2692e2 | 2018-12-04 17:27:59 -0800 | [diff] [blame] | 192 | - Improve splitting before dictionary values. Look more closely to see if the |
| 193 | dictionary entry is a container. If so, then it's probably split over |
| 194 | multiple lines with the opening bracket on the same line as the key. |
| 195 | Therefore, we shouldn't enforce a split because of that. |
Bill Wendling | 05706ac | 2018-12-05 03:44:47 -0800 | [diff] [blame] | 196 | - Increase split penalty around exponent operator. |
Harald Husum | c712893 | 2019-02-08 16:31:41 +0100 | [diff] [blame] | 197 | - Correct spacing when using binary operators on strings with the |
| 198 | `NO_SPACES_AROUND_SELECTED_BINARY_OPERATORS` option enabled. |
Bill Wendling | 225ad43 | 2018-11-27 23:57:42 -0800 | [diff] [blame] | 199 | |
| 200 | ## [0.25.0] 2018-11-25 |
Bill Wendling | c7ff59f | 2018-09-07 04:06:57 -0700 | [diff] [blame] | 201 | ### Added |
| 202 | - Added `INDENT_BLANK_LINES` knob to select whether the blank lines are empty |
| 203 | or indented consistently with the current block. |
Bill Wendling | 868fa31 | 2018-11-25 00:08:31 -0800 | [diff] [blame] | 204 | - Support additional file exclude patterns in .yapfignore file. |
Bill Wendling | 72d83a1 | 2018-09-07 04:09:53 -0700 | [diff] [blame] | 205 | ### Fixed |
| 206 | - Correctly determine if a scope is the last in line. It avoids a wrong |
| 207 | computation of the line end when determining if it must split after the |
| 208 | opening bracket with `DEDENT_CLOSING_BRACKETS` enabled. |
Bill Wendling | c7ff59f | 2018-09-07 04:06:57 -0700 | [diff] [blame] | 209 | |
Bill Wendling | 259f599 | 2018-09-07 04:02:43 -0700 | [diff] [blame] | 210 | ## [0.24.0] 2018-09-07 |
Bill Wendling | 49003a8 | 2018-08-27 18:30:38 -0700 | [diff] [blame] | 211 | ### Added |
| 212 | - Added 'SPLIT_BEFORE_DOT' knob to support "builder style" calls. The "builder |
| 213 | style" option didn't work as advertised. Lines would split after the dots, |
| 214 | not before them regardless of the penalties. |
Bill Wendling | 3d2ce8f | 2018-09-07 03:20:30 -0700 | [diff] [blame] | 215 | ### Changed |
| 216 | - Support Python 3.7 in the tests. The old "comp_for" and "comp_if" nodes are |
| 217 | now "old_comp_for" and "old_comp_if" in lib2to3. |
Bill Wendling | fcbfee1 | 2018-08-28 17:46:41 -0700 | [diff] [blame] | 218 | ### Fixed |
| 219 | - Don't count inner function calls when marking arguments as named assignments. |
Bill Wendling | ea904bd | 2018-08-28 18:08:23 -0700 | [diff] [blame] | 220 | - Make sure that tuples and the like are formatted nicely if they all can't fit |
| 221 | on a single line. This is similar to how we format function calls within an |
| 222 | argument list. |
Bill Wendling | 931f432 | 2018-09-03 18:12:13 -0700 | [diff] [blame] | 223 | - Allow splitting in a subscript if it goes over the line limit. |
Bill Wendling | 30155be | 2018-09-03 18:54:38 -0700 | [diff] [blame] | 224 | - Increase the split penalty for an if-expression. |
Bill Wendling | 50e5442 | 2018-09-03 19:34:51 -0700 | [diff] [blame] | 225 | - Increase penalty for splitting in a subscript so that it's more likely to |
| 226 | split in a function call or other data literal. |
Bill Wendling | 2971001 | 2018-09-07 02:55:56 -0700 | [diff] [blame] | 227 | - Cloning a pytree node doesn't transfer its a annotations. Make sure we do |
| 228 | that so that we don't lose information. |
Bill Wendling | eb95008 | 2018-09-07 03:41:00 -0700 | [diff] [blame] | 229 | - Revert change that broke the "no_spaces_around_binary_operators" option. |
Bill Wendling | 86b27ee | 2018-09-07 03:56:57 -0700 | [diff] [blame] | 230 | - The "--style-help" option would output string lists and sets in Python types. |
| 231 | If the output was used as a style, then it wouldn't parse those values |
| 232 | correctly. |
Bill Wendling | 49003a8 | 2018-08-27 18:30:38 -0700 | [diff] [blame] | 233 | |
Bill Wendling | ffd72cb | 2018-08-27 05:09:42 -0700 | [diff] [blame] | 234 | ## [0.23.0] 2018-08-27 |
Bill Wendling | 4922549 | 2018-07-01 23:02:35 -0700 | [diff] [blame] | 235 | ### Added |
| 236 | - `DISABLE_ENDING_COMMA_HEURISTIC` is a new knob to disable the heuristic which |
| 237 | splits a list onto separate lines if the list is comma-terminated. |
Bill Wendling | 19dbc7a | 2018-05-21 14:29:10 -0700 | [diff] [blame] | 238 | ### Fixed |
| 239 | - There's no need to increase N_TOKENS. In fact, it causes other things which |
| 240 | use lib2to3 to fail if called from YAPF. |
Bill Wendling | a1001b1 | 2018-07-01 22:25:30 -0700 | [diff] [blame] | 241 | - Change the exception message instead of creating a new one that's just a |
| 242 | clone. |
Bill Wendling | dd9f72b | 2018-08-26 20:05:26 -0700 | [diff] [blame] | 243 | - Make sure not to reformat when a line is disabled even if the --lines option |
| 244 | is specified. |
Bill Wendling | dc94ddb | 2018-08-26 21:34:09 -0700 | [diff] [blame] | 245 | - The "no spaces around operators" flag wasn't correctly converting strings to |
| 246 | sets. Changed the regexp to handle it better. |
Bill Wendling | 19dbc7a | 2018-05-21 14:29:10 -0700 | [diff] [blame] | 247 | |
Bill Wendling | d52ae2a | 2018-05-15 22:24:24 -0700 | [diff] [blame] | 248 | ## [0.22.0] 2018-05-15 |
Dan Porter | 61d8809 | 2018-03-22 12:52:16 +0000 | [diff] [blame] | 249 | ### Added |
| 250 | - The `BLANK_LINE_BEFORE_MODULE_DOCSTRING` knob adds a blank line before a |
| 251 | module's docstring. |
cardenb | 83a62ad | 2018-05-14 22:54:12 -0700 | [diff] [blame] | 252 | - The `SPLIT_ALL_COMMA_SEPARATED_VALUES` knob causes all lists, tuples, dicts |
| 253 | function defs, etc... to split on all values, instead of maximizing the |
| 254 | number of elements on each line, when not able to fit on a single line. |
Bill Wendling | 3bab584 | 2018-03-26 22:26:06 -0700 | [diff] [blame] | 255 | ### Changed |
| 256 | - Improve the heuristic we use to determine when to split at the start of a |
| 257 | function call. First check whether or not all elements can fit in the space |
| 258 | without wrapping. If not, then we split. |
Bill Wendling | 2b0b2ca | 2018-03-26 22:56:55 -0700 | [diff] [blame] | 259 | - Check all of the elements of a tuple. Similarly to how arguments are |
| 260 | analyzed. This allows tuples to be split more rationally. |
Bill Wendling | 8f8c5f5 | 2018-03-27 13:43:11 -0700 | [diff] [blame] | 261 | - Adjust splitting penalties around arithmetic operators so that the code can |
| 262 | flow more freely. The code must flow! |
Bill Wendling | 4ddb2fe | 2018-03-27 15:31:54 -0700 | [diff] [blame] | 263 | - Try to meld an argument list's closing parenthesis to the last argument. |
Bill Wendling | d5df208 | 2018-03-26 23:25:45 -0700 | [diff] [blame] | 264 | ### Fixed |
| 265 | - Attempt to determine if long lambdas are allowed. This can be done on a |
| 266 | case-by-case basis with a "pylint" disable comment. |
Bill Wendling | 3d9e998 | 2018-03-27 00:15:30 -0700 | [diff] [blame] | 267 | - A comment before a decorator isn't part of the decorator's line. |
Bill Wendling | d059cc4 | 2018-03-30 20:45:14 -0700 | [diff] [blame] | 268 | - Only force a new wrapped line after a comment in a decorator when it's the |
| 269 | first token in the decorator. |
Dan Porter | 61d8809 | 2018-03-22 12:52:16 +0000 | [diff] [blame] | 270 | |
Bill Wendling | 06a2340 | 2018-03-18 20:42:05 -0700 | [diff] [blame] | 271 | ## [0.21.0] 2018-03-18 |
Patryk Zawadzki | 6d79f13 | 2018-02-13 16:31:25 +0100 | [diff] [blame] | 272 | ### Added |
| 273 | - Introduce a new option of formatting multiline literals. Add |
| 274 | `SPLIT_BEFORE_CLOSING_BRACKET` knob to control whether closing bracket should |
| 275 | get their own line. |
Yinyin L | a56072f | 2018-03-05 02:04:34 +0800 | [diff] [blame] | 276 | - Added `CONTINUATION_ALIGN_STYLE` knob to choose continuation alignment style |
| 277 | when `USE_TABS` is enabled. |
Markus Gerstel | 52ca45a | 2018-02-14 17:07:35 +0000 | [diff] [blame] | 278 | - Add 'BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION' knob to control the number |
| 279 | of blank lines between top-level function and class definitions. |
Bill Wendling | 338c1c4 | 2018-03-14 23:59:49 -0700 | [diff] [blame] | 280 | ### Fixed |
| 281 | - Don't split ellipses. |
Patryk Zawadzki | 6d79f13 | 2018-02-13 16:31:25 +0100 | [diff] [blame] | 282 | |
Bill Wendling | 6e83cf3 | 2018-02-12 13:22:47 -0800 | [diff] [blame] | 283 | ## [0.20.2] 2018-02-12 |
Bill Wendling | 9e3dc4e | 2018-01-24 11:19:24 -0800 | [diff] [blame] | 284 | ### Changed |
| 285 | - Improve the speed at which files are excluded by ignoring them earlier. |
Bill Wendling | 6ae096b | 2018-01-25 22:22:31 -0800 | [diff] [blame] | 286 | - Allow dictionaries to stay on a single line if they only have one entry |
Bill Wendling | d377549 | 2018-01-14 17:43:10 -0800 | [diff] [blame] | 287 | ### Fixed |
| 288 | - Use tabs when constructing a continuation line when `USE_TABS` is enabled. |
Bill Wendling | 7c316cc | 2018-01-24 12:35:26 -0800 | [diff] [blame] | 289 | - A dictionary entry may not end in a colon, but may be an "unpacking" |
Christian Clauss | 633744e | 2021-09-16 20:04:21 +0200 | [diff] [blame] | 290 | operation: `**foo`. Take that into account and don't split after the |
Bill Wendling | 7c316cc | 2018-01-24 12:35:26 -0800 | [diff] [blame] | 291 | unpacking operator. |
Bill Wendling | d377549 | 2018-01-14 17:43:10 -0800 | [diff] [blame] | 292 | |
Bill Wendling | 06c973f | 2018-01-13 22:04:00 -0800 | [diff] [blame] | 293 | ## [0.20.1] 2018-01-13 |
Bill Wendling | a0de11a | 2017-12-17 23:58:02 -0800 | [diff] [blame] | 294 | ### Fixed |
| 295 | - Don't treat 'None' as a keyword if calling a function on it, like '__ne__()'. |
Petter Strandmark | 4d2bee0 | 2018-01-10 21:42:37 +0100 | [diff] [blame] | 296 | - use_tabs=True always uses a single tab per indentation level; spaces are |
| 297 | used for aligning vertically after that. |
Bill Wendling | 06c973f | 2018-01-13 22:04:00 -0800 | [diff] [blame] | 298 | - Relax the split of a paren at the end of an if statement. With |
delirious-lettuce | b795f6d | 2018-01-16 20:38:46 -0700 | [diff] [blame] | 299 | `dedent_closing_brackets` option requires that it be able to split there. |
Bill Wendling | a0de11a | 2017-12-17 23:58:02 -0800 | [diff] [blame] | 300 | |
Bill Wendling | 0b8364e | 2017-11-14 23:45:50 -0800 | [diff] [blame] | 301 | ## [0.20.0] 2017-11-14 |
Matthew Suozzo | f021105 | 2017-11-01 17:52:28 -0400 | [diff] [blame] | 302 | ### Added |
| 303 | - Improve splitting of comprehensions and generators. Add |
| 304 | `SPLIT_PENALTY_COMPREHENSION` knob to control preference for keeping |
| 305 | comprehensions on a single line and `SPLIT_COMPLEX_COMPREHENSION` to enable |
| 306 | splitting each clause of complex comprehensions onto its own line. |
Bill Wendling | 8c07cc1 | 2017-10-16 00:37:58 -0700 | [diff] [blame] | 307 | ### Changed |
| 308 | - Take into account a named function argument when determining if we should |
| 309 | split before the first argument in a function call. |
Bill Wendling | 1dc75ac | 2017-10-16 02:45:46 -0700 | [diff] [blame] | 310 | - Split before the first argument in a function call if the arguments contain a |
| 311 | dictionary that doesn't fit on a single line. |
Bill Wendling | b1c7ca8 | 2017-10-21 00:02:49 -0700 | [diff] [blame] | 312 | - Improve splitting of elements in a tuple. We want to split if there's a |
| 313 | function call in the tuple that doesn't fit on the line. |
Bill Wendling | 7bfc0a9 | 2017-10-16 03:22:19 -0700 | [diff] [blame] | 314 | ### Fixed |
| 315 | - Enforce spaces between ellipses and keywords. |
Bill Wendling | bd9d955 | 2017-10-16 22:45:17 -0700 | [diff] [blame] | 316 | - When calculating the split penalty for a "trailer", process the child nodes |
| 317 | afterwards because their penalties may change. For example if a list |
| 318 | comprehension is an argument. |
Bill Wendling | d404b70 | 2017-10-16 23:16:14 -0700 | [diff] [blame] | 319 | - Don't enforce a split before a comment after the opening of a container if it |
| 320 | doesn't it on the current line. We try hard not to move such comments around. |
Bill Wendling | ca46e86 | 2017-10-24 00:46:11 -0700 | [diff] [blame] | 321 | - Use a TextIOWrapper when reading from stdin in Python3. This is necessary for |
| 322 | some encodings, like cp936, used on Windows. |
Matthew Suozzo | 2112ad2 | 2017-10-29 18:23:03 -0400 | [diff] [blame] | 323 | - Remove the penalty for a split before the first argument in a function call |
| 324 | where the only argument is a generator expression. |
Bill Wendling | 8c07cc1 | 2017-10-16 00:37:58 -0700 | [diff] [blame] | 325 | |
Bill Wendling | 4d9b905 | 2017-10-14 15:02:31 -0700 | [diff] [blame] | 326 | ## [0.19.0] 2017-10-14 |
Bill Wendling | 9680f73 | 2017-10-09 01:11:38 -0700 | [diff] [blame] | 327 | ### Added |
| 328 | - Added `SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN` that enforces a split |
| 329 | after the opening paren of an expression that's surrounded by parens. |
Bill Wendling | 5f83cfb | 2017-10-08 01:12:27 -0700 | [diff] [blame] | 330 | ### Changed |
| 331 | - Split before the ending bracket of a comma-terminated tuple / argument list |
| 332 | if it's not a single element tuple / arg list. |
Bill Wendling | ba55eb1 | 2017-09-19 14:30:02 -0700 | [diff] [blame] | 333 | ### Fixed |
| 334 | - Prefer to split after a comma in an argument list rather than in the middle |
| 335 | of an argument. |
Bill Wendling | 61f93c3 | 2017-10-01 00:35:30 -0700 | [diff] [blame] | 336 | - A non-multiline string may have newlines if it contains continuation markers |
| 337 | itself. Don't add a newline after the string when retaining the vertical |
| 338 | space. |
Bill Wendling | 9df211b | 2017-10-01 01:12:22 -0700 | [diff] [blame] | 339 | - Take into account the "async" keyword when determining if we must split |
| 340 | before the first argument. |
Bill Wendling | 7491187 | 2017-10-04 02:59:30 -0700 | [diff] [blame] | 341 | - Increase affinity for "atom" arguments in function calls. This helps prevent |
| 342 | lists from being separated when they don't need to be. |
Bill Wendling | b00e4f6 | 2017-10-07 03:22:12 -0700 | [diff] [blame] | 343 | - Don't place a dictionary argument on its own line if it's the last argument |
| 344 | in the function call where that function is part of a builder-style call. |
Bill Wendling | a531f21 | 2017-10-12 15:58:29 -0700 | [diff] [blame] | 345 | - Append the "var arg" type to a star in a star_expr. |
Bill Wendling | ba55eb1 | 2017-09-19 14:30:02 -0700 | [diff] [blame] | 346 | |
Bill Wendling | 7ef7e14 | 2017-09-18 16:59:48 -0700 | [diff] [blame] | 347 | ## [0.18.0] 2017-09-18 |
Bill Wendling | 8a3b71f | 2017-08-26 02:34:03 -0700 | [diff] [blame] | 348 | ### Added |
| 349 | - Option `ALLOW_SPLIT_BEFORE_DICT_VALUE` allows a split before a value. If |
| 350 | False, then it won't be split even if it goes over the column limit. |
Bill Wendling | 855860e | 2017-08-24 21:31:33 -0700 | [diff] [blame] | 351 | ### Changed |
| 352 | - Use spaces around the '=' in a typed name argument to align with 3.6 syntax. |
Bill Wendling | 8012f59 | 2017-08-21 01:23:18 -0700 | [diff] [blame] | 353 | ### Fixed |
| 354 | - Allow semicolons if the line is disabled. |
Bouwe Andela | f6dba62 | 2017-08-21 21:33:23 +0200 | [diff] [blame] | 355 | - Fix issue where subsequent comments at decreasing levels of indentation |
| 356 | were improperly aligned and/or caused output with invalid syntax. |
Bill Wendling | 562e04c | 2017-08-23 02:32:11 -0700 | [diff] [blame] | 357 | - Fix issue where specifying a line range removed a needed line before a |
| 358 | comment. |
Bill Wendling | 6e7f5a8 | 2017-08-24 20:15:08 -0700 | [diff] [blame] | 359 | - Fix spacing between unary operators if one is 'not'. |
Bill Wendling | 578854b | 2017-08-24 22:26:59 -0700 | [diff] [blame] | 360 | - Indent the dictionary value correctly if there's a multi-line key. |
Bill Wendling | 8ee1b53 | 2017-09-06 13:58:32 -0700 | [diff] [blame] | 361 | - Don't remove needed spacing before a comment in a dict when in "chromium" |
| 362 | style. |
Bill Wendling | 6412ce7 | 2017-09-18 16:18:48 -0700 | [diff] [blame] | 363 | - Increase indent for continuation line with same indent as next logical line |
| 364 | with 'async with' statement. |
Bill Wendling | 8012f59 | 2017-08-21 01:23:18 -0700 | [diff] [blame] | 365 | |
Bill Wendling | 5f73720 | 2017-08-20 22:03:12 -0700 | [diff] [blame] | 366 | ## [0.17.0] 2017-08-20 |
Jiri Kuncar | f14bd17 | 2017-07-21 09:45:31 +0200 | [diff] [blame] | 367 | ### Added |
| 368 | - Option `NO_SPACES_AROUND_SELECTED_BINARY_OPERATORS` prevents adding spaces |
| 369 | around selected binary operators, in accordance with the current style guide. |
Kevin Cox | c565e83 | 2017-07-21 13:50:47 +0100 | [diff] [blame] | 370 | ### Changed |
| 371 | - Adjust blank lines on formatting boundaries when using the `--lines` option. |
Bill Wendling | 71d9b2e | 2017-08-01 13:38:54 -0700 | [diff] [blame] | 372 | - Return 1 if a diff changed the code. This is in line with how GNU diff acts. |
Max Vorobev | 3b90311 | 2017-08-26 14:43:48 +0300 | [diff] [blame] | 373 | - Add `-vv` flag to print out file names as they are processed |
Richard Wall | acad4ce | 2017-08-04 15:08:40 +0100 | [diff] [blame] | 374 | ### Fixed |
| 375 | - Corrected how `DEDENT_CLOSING_BRACKETS` and `COALESCE_BRACKETS` interacted. |
Bill Wendling | b0de56d | 2017-08-12 15:21:12 -0700 | [diff] [blame] | 376 | - Fix return value to return a boolean. |
Anton Yuzhaninov | db85e87 | 2017-07-19 22:45:45 -0400 | [diff] [blame] | 377 | - Correct vim plugin not to clobber edited code if yapf returns an error. |
Justin Huang | 767edac | 2017-08-12 17:36:41 -0700 | [diff] [blame] | 378 | - Ensured comma-terminated tuples with multiple elements are split onto separate lines. |
Kevin Cox | c565e83 | 2017-07-21 13:50:47 +0100 | [diff] [blame] | 379 | |
Bill Wendling | 4aa43d8 | 2017-07-13 00:45:39 -0700 | [diff] [blame] | 380 | ## [0.16.3] 2017-07-13 |
Bill Wendling | 81a6d84 | 2017-07-12 23:58:17 -0700 | [diff] [blame] | 381 | ### Changed |
delirious-lettuce | b795f6d | 2018-01-16 20:38:46 -0700 | [diff] [blame] | 382 | - Add filename information to a ParseError exception. |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 383 | ### Fixed |
Bill Wendling | 4aa43d8 | 2017-07-13 00:45:39 -0700 | [diff] [blame] | 384 | - A token that ends in a continuation marker may have more than one newline in |
| 385 | it, thus changing its "lineno" value. This can happen if multiple |
| 386 | continuation markers are used with no intervening tokens. Adjust the line |
| 387 | number to account for the lines covered by those markers. |
| 388 | - Make sure to split after a comment even for "pseudo" parentheses. |
| 389 | |
| 390 | ## [0.16.2] 2017-05-19 |
| 391 | ### Fixed |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 392 | - Treat expansion operators ('*', '**') in a similar way to function calls to |
| 393 | avoid splitting directly after the opening parenthesis. |
| 394 | - Increase the penalty for splitting after the start of a tuple. |
Bill Wendling | e67e353 | 2017-03-31 00:43:00 -0700 | [diff] [blame] | 395 | - Increase penalty for excess characters. |
Bill Wendling | 16becc5 | 2017-04-02 19:52:49 -0700 | [diff] [blame] | 396 | - Check that we have enough children before trying to access them all. |
Bill Wendling | da3697c | 2017-04-13 00:32:09 -0700 | [diff] [blame] | 397 | - Remove trailing whitespaces from comments. |
Bill Wendling | a36bb6d | 2017-04-16 18:51:53 -0700 | [diff] [blame] | 398 | - Split before a function call in a list if the full list isn't able to fit on |
| 399 | a single line. |
Bill Wendling | 1cfcbd1 | 2017-04-17 19:38:28 -0700 | [diff] [blame] | 400 | - Trying not to split around the '=' of a named assign. |
Bill Wendling | 81a6d84 | 2017-07-12 23:58:17 -0700 | [diff] [blame] | 401 | - Changed split before the first argument behavior to ignore compound |
| 402 | statements like if and while, but not function declarations. |
| 403 | - Changed coalesce brackets not to line split before closing bracket. |
Bill Wendling | 77ca21d | 2017-03-28 00:41:18 -0700 | [diff] [blame] | 404 | |
Bill Wendling | 5ca3109 | 2017-03-22 11:41:07 -0700 | [diff] [blame] | 405 | ## [0.16.1] 2017-03-22 |
Bill Wendling | 5a1e331 | 2017-02-14 18:40:43 -0800 | [diff] [blame] | 406 | ### Changed |
| 407 | - Improved performance of cloning the format decision state object. This |
| 408 | 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] | 409 | - Relax the requirement that a named argument needs to be on one line. Going |
| 410 | over the column limit is more of an issue to pylint than putting named args |
| 411 | on multiple lines. |
Bill Wendling | 79b82ef | 2017-02-17 00:24:51 -0800 | [diff] [blame] | 412 | - Don't make splitting penalty decisions based on the original formatting. This |
| 413 | can and does lead to non-stable formatting, where yapf will reformat the same |
| 414 | code in different ways. |
Bill Wendling | a952966 | 2017-02-06 21:47:39 -0800 | [diff] [blame] | 415 | ### Fixed |
| 416 | - Ensure splitting of arguments if there's a named assign present. |
Bill Wendling | 56f0fb6 | 2017-02-06 22:58:05 -0800 | [diff] [blame] | 417 | - Prefer to coalesce opening brackets if it's not at the beginning of a |
| 418 | function call. |
Bill Wendling | 313c65a | 2017-02-17 01:56:45 -0800 | [diff] [blame] | 419 | - Prefer not to squish all of the elements in a function call over to the |
| 420 | right-hand side. Split the arguments instead. |
Bill Wendling | 257c1b0 | 2017-02-20 15:32:29 -0800 | [diff] [blame] | 421 | - We need to split a dictionary value if the first element is a comment anyway, |
| 422 | so don't force the split here. It's forced elsewhere. |
CaselIT | d69801d | 2017-02-21 13:45:13 +0100 | [diff] [blame] | 423 | - Ensure tabs are used for continued indentation when USE_TABS is True. |
Bill Wendling | a952966 | 2017-02-06 21:47:39 -0800 | [diff] [blame] | 424 | |
Bill Wendling | 873039e | 2017-02-05 20:24:46 -0800 | [diff] [blame] | 425 | ## [0.16.0] 2017-02-05 |
Bill Wendling | 0e9b321 | 2017-01-31 14:41:00 -0800 | [diff] [blame] | 426 | ### Added |
| 427 | - The `EACH_DICT_ENTRY_ON_SEPARATE_LINE` knob indicates that each dictionary |
| 428 | entry should be in separate lines if the full dictionary isn't able to fit on |
| 429 | a single line. |
| 430 | - The `SPLIT_BEFORE_DICT_SET_GENERATOR` knob splits before the `for` part of a |
| 431 | dictionary/set generator. |
Bill Wendling | 9f49752 | 2017-02-04 04:39:47 -0800 | [diff] [blame] | 432 | - The `BLANK_LINE_BEFORE_CLASS_DOCSTRING` knob adds a blank line before a |
| 433 | class's docstring. |
Bill Wendling | 8d32136 | 2017-02-05 18:29:26 -0800 | [diff] [blame] | 434 | - The `ALLOW_MULTILINE_DICTIONARY_KEYS` knob allows dictionary keys to span |
| 435 | more than one line. |
Bill Wendling | 94962e5 | 2017-02-04 04:07:19 -0800 | [diff] [blame] | 436 | ### Fixed |
| 437 | - Split before all entries in a dict/set or list maker when comma-terminated, |
| 438 | even if there's only one entry. |
Adrian Tejn Kern | bfee67d | 2017-02-05 08:36:02 +0100 | [diff] [blame] | 439 | - Will now try to set O_BINARY mode on stdout under Windows and Python 2. |
| 440 | - Avoid unneeded newline transformation when writing formatted code to |
| 441 | output on (affects only Python 2) |
Bill Wendling | 0e9b321 | 2017-01-31 14:41:00 -0800 | [diff] [blame] | 442 | |
Bill Wendling | 3d470dd | 2017-01-29 19:45:13 -0800 | [diff] [blame] | 443 | ## [0.15.2] 2017-01-29 |
Bill Wendling | bf63118 | 2017-01-24 15:34:35 -0800 | [diff] [blame] | 444 | ### Fixed |
| 445 | - Don't perform a global split when a named assign is part of a function call |
| 446 | which itself is an argument to a function call. I.e., don't cause 'a' to |
| 447 | split here: |
| 448 | |
| 449 | func(a, b, c, d(x, y, z=42)) |
Bill Wendling | b64e702 | 2017-01-25 09:44:41 -0800 | [diff] [blame] | 450 | - Allow splitting inside a subscript if it's a logical or bitwise operating. |
| 451 | This should keep the subscript mostly contiguous otherwise. |
Bill Wendling | bf63118 | 2017-01-24 15:34:35 -0800 | [diff] [blame] | 452 | |
Bill Wendling | 5d7b361 | 2017-01-21 23:43:35 -0800 | [diff] [blame] | 453 | ## [0.15.1] 2017-01-21 |
Bill Wendling | 672ece0 | 2017-01-14 16:35:48 -0800 | [diff] [blame] | 454 | ### Fixed |
| 455 | - Don't insert a space between a type hint and the '=' sign. |
Bill Wendling | b57e71c | 2017-01-14 16:51:35 -0800 | [diff] [blame] | 456 | - The '@' operator can be used in Python 3 for matrix multiplication. Give the |
| 457 | '@' in the decorator a DECORATOR subtype to distinguish it. |
Bill Wendling | fd30b91 | 2017-01-15 16:45:24 -0800 | [diff] [blame] | 458 | - Encourage the formatter to split at the beginning of an argument list instead |
| 459 | of in the middle. Especially if the middle is an empty parameter list. This |
| 460 | adjusts the affinity of binary and comparison operators. In particular, the |
| 461 | "not in" and other such operators don't want to have a split after it (or |
| 462 | before it) if at all possible. |
Bill Wendling | 672ece0 | 2017-01-14 16:35:48 -0800 | [diff] [blame] | 463 | |
Bill Wendling | 61061f6 | 2017-01-12 20:58:55 -0800 | [diff] [blame] | 464 | ## [0.15.0] 2017-01-12 |
| 465 | ### Added |
| 466 | - Keep type annotations intact as much as possible. Don't try to split the over |
delirious-lettuce | b795f6d | 2018-01-16 20:38:46 -0700 | [diff] [blame] | 467 | multiple lines. |
Bill Wendling | b50a6b2 | 2016-11-27 17:06:58 -0800 | [diff] [blame] | 468 | ### Fixed |
| 469 | - When determining if each element in a dictionary can fit on a single line, we |
| 470 | are skipping dictionary entries. However, we need to ignore comments in our |
| 471 | calculations and implicitly concatenated strings, which are already placed on |
| 472 | separate lines. |
Bill Wendling | 596300d | 2016-11-28 13:08:57 -0800 | [diff] [blame] | 473 | - Allow text before a "pylint" comment. |
Bill Wendling | eb979f3 | 2016-11-28 13:16:04 -0800 | [diff] [blame] | 474 | - Also allow text before a "yapf: (disable|enable)" comment. |
Bill Wendling | b50a6b2 | 2016-11-27 17:06:58 -0800 | [diff] [blame] | 475 | |
Bill Wendling | 544a281 | 2016-11-21 15:29:19 -0800 | [diff] [blame] | 476 | ## [0.14.0] 2016-11-21 |
Bill Wendling | 61061f6 | 2017-01-12 20:58:55 -0800 | [diff] [blame] | 477 | ### Added |
Diogo de Campos | 2f246c0 | 2016-10-06 14:04:38 +0200 | [diff] [blame] | 478 | - formatting can be run in parallel using the "-p" / "--parallel" flags. |
Bill Wendling | 6041f22 | 2016-11-02 01:07:39 -0700 | [diff] [blame] | 479 | ### Fixed |
| 480 | - "not in" and "is not" should be subtyped as binary operators. |
Bill Wendling | ccea10e | 2016-11-08 16:26:21 -0800 | [diff] [blame] | 481 | - A non-Node dictionary value may have a comment before it. In those cases, we |
| 482 | want to avoid encompassing only the comment in pseudo parens. So we include |
| 483 | the actual value as well. |
Bill Wendling | f728653 | 2016-11-16 17:52:50 -0800 | [diff] [blame] | 484 | - Adjust calculation so that pseudo-parentheses don't count towards the total |
| 485 | line length. |
Bill Wendling | 508694b | 2016-11-20 23:52:52 -0800 | [diff] [blame] | 486 | - Don't count a dictionary entry as not fitting on a single line in a |
| 487 | dictionary. |
Bill Wendling | 47c3e4f | 2016-11-21 15:25:09 -0800 | [diff] [blame] | 488 | - Don't count pseudo-parentheses in the length of the line. |
Bill Wendling | 6041f22 | 2016-11-02 01:07:39 -0700 | [diff] [blame] | 489 | |
Bill Wendling | 35d6b7c | 2016-10-22 01:18:51 -0700 | [diff] [blame] | 490 | ## [0.13.2] 2016-10-22 |
| 491 | ### Fixed |
| 492 | - REGRESSION: A comment may have a prefix with newlines in it. When calculating |
| 493 | the prefix indent, we cannot take the newlines into account. Otherwise, the |
| 494 | comment will be misplaced causing the code to fail. |
| 495 | |
Bill Wendling | f3e0965 | 2016-10-17 14:26:41 -0700 | [diff] [blame] | 496 | ## [0.13.1] 2016-10-17 |
| 497 | ### Fixed |
| 498 | - Correct emitting a diff that was accidentally removed. |
| 499 | |
Bill Wendling | 31f8213 | 2016-10-16 22:54:01 -0700 | [diff] [blame] | 500 | ## [0.13.0] 2016-10-16 |
Bill Wendling | cec6b19 | 2016-10-16 00:30:02 -0500 | [diff] [blame] | 501 | ### Added |
| 502 | - Added support to retain the original line endings of the source code. |
| 503 | |
Bill Wendling | a5a52e2 | 2016-10-11 13:40:38 -0700 | [diff] [blame] | 504 | ### Fixed |
| 505 | - Functions or classes with comments before them were reformatting the comments |
| 506 | even if the code was supposed to be ignored by the formatter. We now don't |
| 507 | adjust the whitespace before a function's comment if the comment is a |
| 508 | "disabled" line. We also don't count "# yapf: {disable|enable}" as a disabled |
| 509 | line, which seems logical. |
Bill Wendling | e6c9357 | 2016-10-11 20:26:23 -0700 | [diff] [blame] | 510 | - It's not really more readable to split before a dictionary value if it's part |
| 511 | of a dictionary comprehension. |
Bill Wendling | 556f915 | 2016-10-13 01:27:38 -0700 | [diff] [blame] | 512 | - 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] | 513 | comment. (But not between a decorator and a comment.) This is related to PEP8 |
| 514 | error E305. |
Bill Wendling | 0d372eb | 2016-10-14 00:36:21 -0700 | [diff] [blame] | 515 | - Remove O(n^2) algorithm from the line disabling logic. |
Bill Wendling | a5a52e2 | 2016-10-11 13:40:38 -0700 | [diff] [blame] | 516 | |
Bill Wendling | c2620f9 | 2016-10-09 20:40:15 -0700 | [diff] [blame] | 517 | ## [0.12.2] 2016-10-09 |
Bill Wendling | 293cb6c | 2016-10-02 16:46:11 -0700 | [diff] [blame] | 518 | ### Fixed |
| 519 | - If `style.SetGlobalStyle(<create pre-defined style>)` was called and then |
| 520 | `yapf_api.FormatCode` was called, the style set by the first call would be |
| 521 | lost, because it would return the style created by `DEFAULT_STYLE_FACTORY`, |
| 522 | which is set to PEP8 by default. Fix this by making the first call set which |
| 523 | factory we call as the "default" style. |
Bill Wendling | 85b5a63 | 2016-10-03 20:30:43 -0700 | [diff] [blame] | 524 | - Don't force a split before non-function call arguments. |
Bill Wendling | 261c79a | 2016-10-03 20:58:08 -0700 | [diff] [blame] | 525 | - A dictionary being used as an argument to a function call and which can exist |
| 526 | on a single line shouldn't be split. |
Bill Wendling | 35edcbd | 2016-10-03 22:33:34 -0700 | [diff] [blame] | 527 | - 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] | 528 | before the elements in a container. Especially split if there's a comment in |
| 529 | the container. |
Bill Wendling | 690132a | 2016-10-04 22:55:47 -0700 | [diff] [blame] | 530 | - Don't add spaces between star and args in a lambda expression. |
Bill Wendling | eef8fbd | 2016-10-05 00:34:25 -0700 | [diff] [blame] | 531 | - If a nested data structure terminates in a comma, then split before the first |
| 532 | 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] | 533 | |
| 534 | ## [0.12.1] 2016-10-02 |
Bill Wendling | 1960ffc | 2016-10-01 23:57:05 -0700 | [diff] [blame] | 535 | ### Changed |
| 536 | - Dictionary values will be placed on the same line as the key if *all* of the |
| 537 | elements in the dictionary can be placed on one line. Otherwise, the |
| 538 | dictionary values will be placed on the next line. |
| 539 | |
Bill Wendling | e041244 | 2016-09-28 02:19:31 -0700 | [diff] [blame] | 540 | ### Fixed |
| 541 | - Prefer to split before a terminating r-paren in an argument list if the line |
| 542 | would otherwise go over the column limit. |
Bill Wendling | 21836ef | 2016-09-28 19:13:16 -0700 | [diff] [blame] | 543 | - Split before the first key in a dictionary if the dictionary cannot fit on a |
| 544 | single line. |
Bill Wendling | 6199707 | 2016-09-30 00:45:59 -0700 | [diff] [blame] | 545 | - Don't count "pylint" comments when determining if the line goes over the |
| 546 | column limit. |
Bill Wendling | 0e70357 | 2016-10-01 23:02:32 -0700 | [diff] [blame] | 547 | - Don't count the argument list of a lambda as a named assign in a function |
| 548 | call. |
Bill Wendling | e041244 | 2016-09-28 02:19:31 -0700 | [diff] [blame] | 549 | |
Bill Wendling | 1b91963 | 2016-09-25 16:03:04 -0700 | [diff] [blame] | 550 | ## [0.12.0] 2016-09-25 |
Bill Wendling | 90eab55 | 2016-08-19 23:47:23 -0700 | [diff] [blame] | 551 | ### Added |
| 552 | - Support formatting of typed names. Typed names are formatted a similar way to |
| 553 | how named arguments are formatted, except that there's a space after the |
| 554 | colon. |
Alexander Lenz | 5fda36a | 2016-08-26 17:27:57 +0200 | [diff] [blame] | 555 | - Add a knob, 'SPACES_AROUND_DEFAULT_OR_NAMED_ASSIGN', to allow adding spaces |
| 556 | around the assign operator on default or named assigns. |
Bill Wendling | 90eab55 | 2016-08-19 23:47:23 -0700 | [diff] [blame] | 557 | |
Bill Wendling | 7c7f603 | 2016-08-31 10:46:33 -0700 | [diff] [blame] | 558 | ## Changed |
| 559 | - Turn "verification" off by default for external APIs. |
Bill Wendling | f0dd0a4 | 2016-09-25 15:54:02 -0700 | [diff] [blame] | 560 | - If a function call in an argument list won't fit on the current line but will |
| 561 | fit on a line by itself, then split before the call so that it won't be split |
| 562 | up unnecessarily. |
Bill Wendling | 7c7f603 | 2016-08-31 10:46:33 -0700 | [diff] [blame] | 563 | |
Bill Wendling | a6fb6f7 | 2016-09-17 14:39:26 -0700 | [diff] [blame] | 564 | ## Fixed |
| 565 | - Don't add space after power operator if the next operator's a unary operator. |
| 566 | |
Bill Wendling | 79ee44a | 2016-08-17 00:33:02 -0700 | [diff] [blame] | 567 | ## [0.11.1] 2016-08-17 |
Bill Wendling | 7b87b0a | 2016-08-17 00:01:56 -0700 | [diff] [blame] | 568 | ### Changed |
| 569 | - Issue #228: Return exit code 0 on success, regardless of whether files were |
| 570 | changed. (Previously, 0 meant success with no files |
| 571 | modified, and 2 meant success with at least one file modified.) |
| 572 | |
Bill Wendling | f4de4c6 | 2016-07-21 00:08:29 -0700 | [diff] [blame] | 573 | ### Fixed |
| 574 | - Enforce splitting each element in a dictionary if comma terminated. |
Bill Wendling | b8d20bd | 2016-08-05 23:44:23 -0700 | [diff] [blame] | 575 | - It's okay to split in the middle of a dotted name if the whole expression is |
| 576 | going to go over the column limit. |
Bill Wendling | 15edda2 | 2016-08-15 17:04:26 -0700 | [diff] [blame] | 577 | - Asynchronous functions were going missing if they were preceded by a comment |
| 578 | (a what? exactly). The asynchronous function processing wasn't taking the |
| 579 | comment into account and thus skipping the whole function. |
Bill Wendling | 7b87b0a | 2016-08-17 00:01:56 -0700 | [diff] [blame] | 580 | - The splitting of arguments when comma terminated had a conflict. The split |
| 581 | penalty of the closing bracket was set to the maximum, but it shouldn't be if |
| 582 | the closing bracket is preceded by a comma. |
Reece Hart | 039c0b5 | 2016-08-11 13:46:15 -0700 | [diff] [blame] | 583 | |
Bill Wendling | 1d8638e | 2016-07-17 00:06:01 -0700 | [diff] [blame] | 584 | ## [0.11.0] 2016-07-17 |
Ben Plotnick | 7e08829 | 2016-06-09 18:29:56 -0700 | [diff] [blame] | 585 | ### Added |
| 586 | - The COALESCE_BRACKETS knob prevents splitting consecutive brackets when |
| 587 | DEDENT_CLOSING_BRACKETS is set. |
Bill Wendling | 61e80c0 | 2016-07-14 16:50:10 -0700 | [diff] [blame] | 588 | - Don't count "pylint" directives as exceeding the column limit. |
Ben Plotnick | 7e08829 | 2016-06-09 18:29:56 -0700 | [diff] [blame] | 589 | |
Bill Wendling | 3363671 | 2016-07-16 02:49:28 -0700 | [diff] [blame] | 590 | ### Changed |
| 591 | - 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] | 592 | 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] | 593 | things look a bit better. |
| 594 | |
Bill Wendling | 4761b18 | 2016-07-03 00:11:14 -0700 | [diff] [blame] | 595 | ### Fixed |
| 596 | - When retaining format of a multiline string with Chromium style, make sure |
| 597 | 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] | 598 | - Correct for when 'lib2to3' smooshes comments together into the same DEDENT |
| 599 | node. |
Bill Wendling | 4761b18 | 2016-07-03 00:11:14 -0700 | [diff] [blame] | 600 | |
Bill Wendling | 7521d4b | 2016-06-14 01:35:38 -0700 | [diff] [blame] | 601 | ## [0.10.0] 2016-06-14 |
Dracony | e582d63 | 2016-06-05 11:48:26 +0200 | [diff] [blame] | 602 | ### Added |
| 603 | - Add a knob, 'USE_TABS', to allow using tabs for indentation. |
Bill Wendling | 184c2de | 2016-06-13 03:21:04 -0700 | [diff] [blame] | 604 | |
Bill Wendling | b0285ba | 2016-05-31 16:10:59 -0700 | [diff] [blame] | 605 | ### Changed |
| 606 | - Performance enhancements. |
| 607 | |
Dracony | e582d63 | 2016-06-05 11:48:26 +0200 | [diff] [blame] | 608 | ### Fixed |
Bill Wendling | d02b592 | 2016-06-03 23:48:19 -0700 | [diff] [blame] | 609 | - Don't split an import list if it's not surrounded by parentheses. |
| 610 | |
Bill Wendling | 90f361f | 2016-05-29 16:13:10 -0700 | [diff] [blame] | 611 | ## [0.9.0] 2016-05-29 |
Bill Wendling | a6988c3 | 2016-05-22 18:47:11 -0700 | [diff] [blame] | 612 | ### Added |
Bill Wendling | 1e16159 | 2016-05-23 16:34:03 -0700 | [diff] [blame] | 613 | - Added a knob (SPLIT_PENALTY_BEFORE_IF_EXPR) to adjust the split penalty |
| 614 | before an if expression. This allows the user to place a list comprehension |
| 615 | all on one line. |
| 616 | - Added a knob (SPLIT_BEFORE_FIRST_ARGUMENT) that encourages splitting before |
| 617 | the first element of a list of arguments or parameters if they are going to |
| 618 | be split anyway. |
Bill Wendling | 86e5178 | 2016-05-24 00:47:44 -0700 | [diff] [blame] | 619 | - Added a knob (SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED) splits arguments to a |
| 620 | function if the list is terminated by a comma. |
Bill Wendling | a6988c3 | 2016-05-22 18:47:11 -0700 | [diff] [blame] | 621 | |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 622 | ### Fixed |
| 623 | - Don't split before a first element list argument as we would before a first |
| 624 | element function call. |
Bill Wendling | e8a8569 | 2016-05-21 23:57:20 -0700 | [diff] [blame] | 625 | - Don't penalize when we must split a line. |
Bill Wendling | 283f4ea | 2016-05-23 16:19:15 -0700 | [diff] [blame] | 626 | - Allow splitting before the single argument in a function call. |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 627 | |
Bill Wendling | d2a585d | 2016-05-21 00:41:24 -0700 | [diff] [blame] | 628 | ## [0.8.2] 2016-05-21 |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 629 | ### Fixed |
| 630 | - Prefer not to split after the opening of a subscript. |
Bill Wendling | 1e179bb | 2016-05-19 01:51:34 -0700 | [diff] [blame] | 631 | - Don't add space before the 'await' keyword if it's preceded by an opening |
| 632 | paren. |
Bill Wendling | 4b6cead | 2016-05-19 11:33:38 -0700 | [diff] [blame] | 633 | - When we're setting the split penalty for a continuous list, we don't want to |
| 634 | 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] | 635 | - When calculating blank lines, don't assume the last seen object was a class |
| 636 | or function when we're in a class or function. |
Bill Wendling | f61861d | 2016-05-21 00:36:27 -0700 | [diff] [blame] | 637 | - Don't count the closing scope when determining if the current scope is the |
| 638 | last scope on the line. |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 639 | |
Bill Wendling | de2c5b2 | 2016-05-18 21:10:29 -0700 | [diff] [blame] | 640 | ## [0.8.1] 2016-05-18 |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 641 | ### Fixed |
| 642 | - 'SPLIT_BEFORE_LOGICAL_OPERATOR' wasn't working correctly. The penalty was |
| 643 | being set incorrectly when it was part of a larger construct. |
Bill Wendling | 99cbd56 | 2016-05-15 18:41:12 -0700 | [diff] [blame] | 644 | - Don't separate a keyword, like "await", from a left paren. |
Bill Wendling | 311c087 | 2016-05-18 01:51:12 -0700 | [diff] [blame] | 645 | - Don't rely upon the original tokens' line number to determine if we should |
| 646 | perform splitting in Facebook mode. The line number isn't the line number of |
| 647 | the reformatted token, but the line number where it was in the original code. |
| 648 | Instead, we need to carefully determine if the line is liabel to be split and |
| 649 | act accordingly. |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 650 | |
Bill Wendling | fe7a4ac | 2016-05-10 23:51:57 -0700 | [diff] [blame] | 651 | ## [0.8.0] 2016-05-10 |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 652 | ### Added |
Bill Wendling | 43eaa75 | 2016-05-12 01:25:20 -0700 | [diff] [blame] | 653 | - Add a knob, 'SPACES_AROUND_POWER_OPERATOR', to allow adding spaces around the |
| 654 | power operator. |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 655 | |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 656 | ### Fixed |
| 657 | - 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] | 658 | - If we split before a bitwise operator, then we assume that the programmer |
| 659 | knows what they're doing, more or less, and so we enforce a split before said |
| 660 | operator if one exists in the original program. |
Bill Wendling | adf1d44 | 2016-05-10 01:03:50 -0700 | [diff] [blame] | 661 | - Strengthen the bond between a keyword and value argument. |
Bill Wendling | 93c42d9 | 2016-05-10 23:35:57 -0700 | [diff] [blame] | 662 | - Don't add a blank line after a multiline string. |
Bill Wendling | cae1edd | 2016-05-10 23:49:19 -0700 | [diff] [blame] | 663 | - If the "for" part of a list comprehension can exist on the starting line |
| 664 | without going over the column limit, then let it remain there. |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 665 | |
Bill Wendling | 8d36eb8 | 2016-04-21 02:33:36 -0700 | [diff] [blame] | 666 | ## [0.7.1] 2016-04-21 |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 667 | ### Fixed |
| 668 | - Don't rewrite the file if there are no changes. |
Bill Wendling | ac00a25 | 2016-04-12 05:31:03 -0700 | [diff] [blame] | 669 | - Ensure the proper number of blank lines before an async function. |
Bill Wendling | c4a4965 | 2016-04-13 13:42:43 -0700 | [diff] [blame] | 670 | - Split after a bitwise operator when in PEP 8 mode. |
Bill Wendling | 423759f | 2016-04-14 21:14:20 -0700 | [diff] [blame] | 671 | - Retain the splitting within a dictionary data literal between the key and |
| 672 | value. |
Bill Wendling | 9882f3d | 2016-04-21 02:29:35 -0700 | [diff] [blame] | 673 | - Try to keep short function calls all on one line even if they're part of a |
| 674 | larger series of tokens. This stops us from splitting too much. |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 675 | |
Bill Wendling | defe5f3 | 2016-04-09 22:29:51 -0700 | [diff] [blame] | 676 | ## [0.7.0] 2016-04-09 |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 677 | ### Added |
Bill Wendling | 5758e4d | 2016-03-19 03:38:48 -0700 | [diff] [blame] | 678 | - Support for Python 3.5. |
| 679 | - Add 'ALLOW_MULTILINE_LAMBDAS' which allows lambdas to be formatted onto |
| 680 | multiple lines. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 681 | |
| 682 | ### Fixed |
| 683 | - Lessen penalty for splitting before a dictionary keyword. |
Bill Wendling | 90a2aa5 | 2016-03-20 02:25:13 -0700 | [diff] [blame] | 684 | - Formatting of trailing comments on disabled formatting lines. |
Bill Wendling | 2064d88 | 2016-04-09 22:21:15 -0700 | [diff] [blame] | 685 | - Disable / enable formatting at end of multi-line comment. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 686 | |
Bill Wendling | 0bca2aa | 2016-03-06 20:44:14 -0800 | [diff] [blame] | 687 | ## [0.6.3] 2016-03-06 |
| 688 | ### Changed |
| 689 | - Documentation updated. |
| 690 | |
Bill Wendling | 95e47b9 | 2015-11-04 22:58:30 -0800 | [diff] [blame] | 691 | ### Fixed |
| 692 | - Fix spacing of multiline comments when formatting is disabled. |
| 693 | |
Bill Wendling | 9ffd815 | 2015-11-01 17:49:25 -0800 | [diff] [blame] | 694 | ## [0.6.2] 2015-11-01 |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 695 | ### Changed |
| 696 | - Look at the 'setup.cfg' file to see if it contains style information for |
| 697 | YAPF. |
Bill Wendling | 169790e | 2015-10-25 03:13:13 -0700 | [diff] [blame] | 698 | - Look at the '~/.config/yapf/style' file to see if it contains global style |
| 699 | information for YAPF. |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 700 | |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 701 | ### Fixed |
| 702 | - 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] | 703 | - Correct formatting of '*args' and '**kwargs' when there are default values in |
| 704 | the argument list. |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 705 | |
Bill Wendling | 348b2f3 | 2015-10-24 03:20:10 -0700 | [diff] [blame] | 706 | ## [0.6.1] 2015-10-24 |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 707 | ### Fixed |
| 708 | - Make sure to align comments in data literals correctly. Also make sure we |
| 709 | don't count a "#." in a string as an i18n comment. |
Bill Wendling | a6b57a6 | 2015-10-20 13:57:52 -0700 | [diff] [blame] | 710 | - Retain proper vertical spacing before comments in a data literal. |
Bill Wendling | 843e48c | 2015-10-20 16:53:08 -0700 | [diff] [blame] | 711 | - Make sure that continuations from a compound statement are distinguished from |
| 712 | the succeeding line. |
Christian Clauss | 633744e | 2021-09-16 20:04:21 +0200 | [diff] [blame] | 713 | - Ignore preceding comments when calculating what is a "dictionary maker". |
Bill Wendling | a558572 | 2015-10-21 15:32:22 -0700 | [diff] [blame] | 714 | - Add a small penalty for splitting before a closing bracket. |
Bill Wendling | dbcf342 | 2015-10-21 22:11:15 -0700 | [diff] [blame] | 715 | - Ensure that a space is enforced after we remove a pseudo-paren that's between |
| 716 | two names, keywords, numbers, etc. |
Bill Wendling | f885672 | 2015-10-21 23:53:29 -0700 | [diff] [blame] | 717 | - Increase the penalty for splitting after a pseudo-paren. This could lead to |
| 718 | less readable code in some circumstances. |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 719 | |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 720 | ## [0.6.0] 2015-10-18 |
Bill Wendling | a5cef8e | 2015-10-15 21:42:03 -0700 | [diff] [blame] | 721 | ### Added |
| 722 | - Add knob to indent the dictionary value if there is a split before it. |
| 723 | |
Bill Wendling | cec6696 | 2015-10-17 04:08:23 -0700 | [diff] [blame] | 724 | ### Changed |
| 725 | - No longer check that a file is a "Python" file unless the '--recursive' flag |
| 726 | is specified. |
| 727 | - No longer allow the user to specify a directory unless the '--recursive' flag |
| 728 | is specified. |
| 729 | |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 730 | ### Fixed |
| 731 | - When determining if we should split a dictionary's value to a new line, use |
| 732 | the longest entry instead of the total dictionary's length. This allows the |
| 733 | formatter to reformat the dictionary in a more consistent manner. |
Bill Wendling | 0946c0f | 2015-10-12 00:42:30 -0700 | [diff] [blame] | 734 | - Improve how list comprehensions are formatted. Make splitting dependent upon |
| 735 | whether the "comp_for" or "comp_if" goes over the column limit. |
Bill Wendling | 43bdc7b | 2015-10-12 14:25:30 -0700 | [diff] [blame] | 736 | - Don't over indent if expression hanging indents if we expect to dedent the |
| 737 | closing bracket. |
Bill Wendling | c1052c6 | 2015-10-15 03:12:28 -0700 | [diff] [blame] | 738 | - Improve splitting heuristic when the first argument to a function call is |
| 739 | itself a function call with arguments. In cases like this, the remaining |
| 740 | arguments to the function call would look badly aligned, even though they are |
Christian Clauss | 633744e | 2021-09-16 20:04:21 +0200 | [diff] [blame] | 741 | technically correct (the best kind of correct!). |
Bill Wendling | b1037b5 | 2015-10-15 22:38:19 -0700 | [diff] [blame] | 742 | - Improve splitting heuristic more so that if the first argument to a function |
| 743 | call is a data literal that will go over the column limit, then we want to |
| 744 | split before it. |
Bill Wendling | 8d8f512 | 2015-10-16 11:46:23 -0700 | [diff] [blame] | 745 | - Remove spaces around '**' operator. |
Bill Wendling | f8325e6 | 2015-10-16 15:38:54 -0700 | [diff] [blame] | 746 | - Retain formatting of comments in the middle of an expression. |
Bill Wendling | 454cef6 | 2015-10-18 03:49:03 -0700 | [diff] [blame] | 747 | - Don't add a newline to an empty file. |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 748 | - Over indent a function's parameter list if it's not distinguished from the |
| 749 | body of the function. |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 750 | |
Bill Wendling | 2aff7fc | 2015-10-11 14:08:10 -0700 | [diff] [blame] | 751 | ## [0.5.0] 2015-10-11 |
Bill Wendling | d03c99f | 2015-10-08 21:06:07 -0700 | [diff] [blame] | 752 | ### Added |
| 753 | - Add option to exclude files/directories from formatting. |
Bill Wendling | 5c60873 | 2015-10-10 23:39:16 -0700 | [diff] [blame] | 754 | - 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] | 755 | |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 756 | ### Fixed |
| 757 | - Indent the continuation of an if-then statement when it's not distinguished |
| 758 | from the body of the if-then. |
Bill Wendling | 1ce18c7 | 2015-10-10 23:12:16 -0700 | [diff] [blame] | 759 | - Allow for sensible splitting of array indices where appropriate. |
Bill Wendling | be974d8 | 2015-10-11 01:04:00 -0700 | [diff] [blame] | 760 | - Prefer to not split before the ending bracket of an atom. This produces |
| 761 | better code in most cases. |
Bill Wendling | bbd148c | 2015-10-11 01:45:24 -0700 | [diff] [blame] | 762 | - Corrected how horizontal spaces were presevered in a disabled region. |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 763 | |
Bill Wendling | 967c3b2 | 2015-10-07 22:20:18 -0700 | [diff] [blame] | 764 | ## [0.4.0] 2015-10-07 |
Łukasz Langa | 9408987 | 2015-09-22 16:02:26 -0700 | [diff] [blame] | 765 | ### Added |
| 766 | - Support for dedenting closing brackets, "facebook" style. |
| 767 | |
Bill Wendling | 25c8e60 | 2015-10-04 20:48:35 -0700 | [diff] [blame] | 768 | ### Fixed |
| 769 | - Formatting of tokens after a multiline string didn't retain their horizontal |
| 770 | spacing. |
| 771 | |
Bill Wendling | 06865ab | 2015-09-30 01:25:47 -0700 | [diff] [blame] | 772 | ## [0.3.1] 2015-09-30 |
| 773 | ### Fixed |
| 774 | - Format closing scope bracket correctly when indentation size changes. |
| 775 | |
Bill Wendling | a690a62 | 2015-09-20 12:38:50 -0700 | [diff] [blame] | 776 | ## [0.3.0] 2015-09-20 |
| 777 | ### Added |
| 778 | - Return a 2 if the source changed, 1 on error, and 0 for no change. |
| 779 | |
| 780 | ### Fixed |
| 781 | - Make sure we format if the "lines" specified are in the middle of a |
| 782 | statement. |
| 783 | |
Bill Wendling | 9adfa0c | 2015-09-13 05:37:30 -0700 | [diff] [blame] | 784 | ## [0.2.9] - 2015-09-13 |
| 785 | ### Fixed |
| 786 | - Formatting of multiple files. It was halting after formatting the first file. |
| 787 | |
Bill Wendling | dcafd5f | 2015-09-12 15:26:03 -0700 | [diff] [blame] | 788 | ## [0.2.8] - 2015-09-12 |
| 789 | ### Added |
| 790 | - Return a non-zero exit code if the source was changed. |
| 791 | - Add bitwise operator splitting penalty and prefer to split before bitwise |
| 792 | operators. |
| 793 | |
| 794 | ### Fixed |
| 795 | - Retain vertical spacing between disabled and enabled lines. |
| 796 | - Split only at start of named assign. |
| 797 | - Retain comment position when formatting is disabled. |
| 798 | - Honor splitting before or after logical ops. |