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 | a6988c3 | 2016-05-22 18:47:11 -0700 | [diff] [blame] | 5 | ## [0.9.0] UNRELEASED |
| 6 | ### Added |
| 7 | - Added a knob to adjust the split penalty before an if expression. This allows |
| 8 | the user to place a list comprehension all on one line. |
| 9 | |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 10 | ### Fixed |
| 11 | - Don't split before a first element list argument as we would before a first |
| 12 | element function call. |
Bill Wendling | e8a8569 | 2016-05-21 23:57:20 -0700 | [diff] [blame] | 13 | - Don't penalize when we must split a line. |
Bill Wendling | 283f4ea | 2016-05-23 16:19:15 -0700 | [diff] [blame^] | 14 | - Allow splitting before the single argument in a function call. |
Bill Wendling | 7edb384 | 2016-05-21 15:07:54 -0700 | [diff] [blame] | 15 | |
Bill Wendling | d2a585d | 2016-05-21 00:41:24 -0700 | [diff] [blame] | 16 | ## [0.8.2] 2016-05-21 |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 17 | ### Fixed |
| 18 | - Prefer not to split after the opening of a subscript. |
Bill Wendling | 1e179bb | 2016-05-19 01:51:34 -0700 | [diff] [blame] | 19 | - Don't add space before the 'await' keyword if it's preceded by an opening |
| 20 | paren. |
Bill Wendling | 4b6cead | 2016-05-19 11:33:38 -0700 | [diff] [blame] | 21 | - When we're setting the split penalty for a continuous list, we don't want to |
| 22 | 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] | 23 | - When calculating blank lines, don't assume the last seen object was a class |
| 24 | or function when we're in a class or function. |
Bill Wendling | f61861d | 2016-05-21 00:36:27 -0700 | [diff] [blame] | 25 | - Don't count the closing scope when determining if the current scope is the |
| 26 | last scope on the line. |
Bill Wendling | 72cd234 | 2016-05-19 01:28:58 -0700 | [diff] [blame] | 27 | |
Bill Wendling | de2c5b2 | 2016-05-18 21:10:29 -0700 | [diff] [blame] | 28 | ## [0.8.1] 2016-05-18 |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 29 | ### Fixed |
| 30 | - 'SPLIT_BEFORE_LOGICAL_OPERATOR' wasn't working correctly. The penalty was |
| 31 | being set incorrectly when it was part of a larger construct. |
Bill Wendling | 99cbd56 | 2016-05-15 18:41:12 -0700 | [diff] [blame] | 32 | - Don't separate a keyword, like "await", from a left paren. |
Bill Wendling | 311c087 | 2016-05-18 01:51:12 -0700 | [diff] [blame] | 33 | - Don't rely upon the original tokens' line number to determine if we should |
| 34 | perform splitting in Facebook mode. The line number isn't the line number of |
| 35 | the reformatted token, but the line number where it was in the original code. |
| 36 | Instead, we need to carefully determine if the line is liabel to be split and |
| 37 | act accordingly. |
Bill Wendling | 8f1d140 | 2016-05-14 19:22:48 -0700 | [diff] [blame] | 38 | |
Bill Wendling | fe7a4ac | 2016-05-10 23:51:57 -0700 | [diff] [blame] | 39 | ## [0.8.0] 2016-05-10 |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 40 | ### Added |
Bill Wendling | 43eaa75 | 2016-05-12 01:25:20 -0700 | [diff] [blame] | 41 | - Add a knob, 'SPACES_AROUND_POWER_OPERATOR', to allow adding spaces around the |
| 42 | power operator. |
Bill Wendling | 9dc7908 | 2016-05-10 00:23:53 -0700 | [diff] [blame] | 43 | |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 44 | ### Fixed |
| 45 | - 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] | 46 | - If we split before a bitwise operator, then we assume that the programmer |
| 47 | knows what they're doing, more or less, and so we enforce a split before said |
| 48 | operator if one exists in the original program. |
Bill Wendling | adf1d44 | 2016-05-10 01:03:50 -0700 | [diff] [blame] | 49 | - Strengthen the bond between a keyword and value argument. |
Bill Wendling | 93c42d9 | 2016-05-10 23:35:57 -0700 | [diff] [blame] | 50 | - Don't add a blank line after a multiline string. |
Bill Wendling | cae1edd | 2016-05-10 23:49:19 -0700 | [diff] [blame] | 51 | - If the "for" part of a list comprehension can exist on the starting line |
| 52 | without going over the column limit, then let it remain there. |
Bill Wendling | f015a3c | 2016-04-21 20:14:24 -0700 | [diff] [blame] | 53 | |
Bill Wendling | 8d36eb8 | 2016-04-21 02:33:36 -0700 | [diff] [blame] | 54 | ## [0.7.1] 2016-04-21 |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 55 | ### Fixed |
| 56 | - Don't rewrite the file if there are no changes. |
Bill Wendling | ac00a25 | 2016-04-12 05:31:03 -0700 | [diff] [blame] | 57 | - Ensure the proper number of blank lines before an async function. |
Bill Wendling | c4a4965 | 2016-04-13 13:42:43 -0700 | [diff] [blame] | 58 | - Split after a bitwise operator when in PEP 8 mode. |
Bill Wendling | 423759f | 2016-04-14 21:14:20 -0700 | [diff] [blame] | 59 | - Retain the splitting within a dictionary data literal between the key and |
| 60 | value. |
Bill Wendling | 9882f3d | 2016-04-21 02:29:35 -0700 | [diff] [blame] | 61 | - Try to keep short function calls all on one line even if they're part of a |
| 62 | larger series of tokens. This stops us from splitting too much. |
Bill Wendling | 4dc472d | 2016-04-10 03:03:55 -0700 | [diff] [blame] | 63 | |
Bill Wendling | defe5f3 | 2016-04-09 22:29:51 -0700 | [diff] [blame] | 64 | ## [0.7.0] 2016-04-09 |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 65 | ### Added |
Bill Wendling | 5758e4d | 2016-03-19 03:38:48 -0700 | [diff] [blame] | 66 | - Support for Python 3.5. |
| 67 | - Add 'ALLOW_MULTILINE_LAMBDAS' which allows lambdas to be formatted onto |
| 68 | multiple lines. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 69 | |
| 70 | ### Fixed |
| 71 | - Lessen penalty for splitting before a dictionary keyword. |
Bill Wendling | 90a2aa5 | 2016-03-20 02:25:13 -0700 | [diff] [blame] | 72 | - Formatting of trailing comments on disabled formatting lines. |
Bill Wendling | 2064d88 | 2016-04-09 22:21:15 -0700 | [diff] [blame] | 73 | - Disable / enable formatting at end of multi-line comment. |
Bill Wendling | 2e58851 | 2016-03-13 01:02:47 -0800 | [diff] [blame] | 74 | |
Bill Wendling | 0bca2aa | 2016-03-06 20:44:14 -0800 | [diff] [blame] | 75 | ## [0.6.3] 2016-03-06 |
| 76 | ### Changed |
| 77 | - Documentation updated. |
| 78 | |
Bill Wendling | 95e47b9 | 2015-11-04 22:58:30 -0800 | [diff] [blame] | 79 | ### Fixed |
| 80 | - Fix spacing of multiline comments when formatting is disabled. |
| 81 | |
Bill Wendling | 9ffd815 | 2015-11-01 17:49:25 -0800 | [diff] [blame] | 82 | ## [0.6.2] 2015-11-01 |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 83 | ### Changed |
| 84 | - Look at the 'setup.cfg' file to see if it contains style information for |
| 85 | YAPF. |
Bill Wendling | 169790e | 2015-10-25 03:13:13 -0700 | [diff] [blame] | 86 | - Look at the '~/.config/yapf/style' file to see if it contains global style |
| 87 | information for YAPF. |
Bill Wendling | 6e8ca7b | 2015-10-25 01:16:43 -0700 | [diff] [blame] | 88 | |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 89 | ### Fixed |
| 90 | - 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] | 91 | - Correct formatting of '*args' and '**kwargs' when there are default values in |
| 92 | the argument list. |
Bill Wendling | 57ffbbb | 2015-10-25 00:20:14 -0700 | [diff] [blame] | 93 | |
Bill Wendling | 348b2f3 | 2015-10-24 03:20:10 -0700 | [diff] [blame] | 94 | ## [0.6.1] 2015-10-24 |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 95 | ### Fixed |
| 96 | - Make sure to align comments in data literals correctly. Also make sure we |
| 97 | don't count a "#." in a string as an i18n comment. |
Bill Wendling | a6b57a6 | 2015-10-20 13:57:52 -0700 | [diff] [blame] | 98 | - Retain proper vertical spacing before comments in a data literal. |
Bill Wendling | 843e48c | 2015-10-20 16:53:08 -0700 | [diff] [blame] | 99 | - Make sure that continuations from a compound statement are distinguished from |
| 100 | the succeeding line. |
Bill Wendling | 81e37b6 | 2015-10-21 13:18:29 -0700 | [diff] [blame] | 101 | - Ignore preceding comments when calculating what is a "dictonary maker". |
Bill Wendling | a558572 | 2015-10-21 15:32:22 -0700 | [diff] [blame] | 102 | - Add a small penalty for splitting before a closing bracket. |
Bill Wendling | dbcf342 | 2015-10-21 22:11:15 -0700 | [diff] [blame] | 103 | - Ensure that a space is enforced after we remove a pseudo-paren that's between |
| 104 | two names, keywords, numbers, etc. |
Bill Wendling | f885672 | 2015-10-21 23:53:29 -0700 | [diff] [blame] | 105 | - Increase the penalty for splitting after a pseudo-paren. This could lead to |
| 106 | less readable code in some circumstances. |
Bill Wendling | 3a3cb6d | 2015-10-20 13:40:27 -0700 | [diff] [blame] | 107 | |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 108 | ## [0.6.0] 2015-10-18 |
Bill Wendling | a5cef8e | 2015-10-15 21:42:03 -0700 | [diff] [blame] | 109 | ### Added |
| 110 | - Add knob to indent the dictionary value if there is a split before it. |
| 111 | |
Bill Wendling | cec6696 | 2015-10-17 04:08:23 -0700 | [diff] [blame] | 112 | ### Changed |
| 113 | - No longer check that a file is a "Python" file unless the '--recursive' flag |
| 114 | is specified. |
| 115 | - No longer allow the user to specify a directory unless the '--recursive' flag |
| 116 | is specified. |
| 117 | |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 118 | ### Fixed |
| 119 | - When determining if we should split a dictionary's value to a new line, use |
| 120 | the longest entry instead of the total dictionary's length. This allows the |
| 121 | formatter to reformat the dictionary in a more consistent manner. |
Bill Wendling | 0946c0f | 2015-10-12 00:42:30 -0700 | [diff] [blame] | 122 | - Improve how list comprehensions are formatted. Make splitting dependent upon |
| 123 | whether the "comp_for" or "comp_if" goes over the column limit. |
Bill Wendling | 43bdc7b | 2015-10-12 14:25:30 -0700 | [diff] [blame] | 124 | - Don't over indent if expression hanging indents if we expect to dedent the |
| 125 | closing bracket. |
Bill Wendling | c1052c6 | 2015-10-15 03:12:28 -0700 | [diff] [blame] | 126 | - Improve splitting heuristic when the first argument to a function call is |
| 127 | itself a function call with arguments. In cases like this, the remaining |
| 128 | arguments to the function call would look badly aligned, even though they are |
| 129 | techincally correct (the best kind of correct!). |
Bill Wendling | b1037b5 | 2015-10-15 22:38:19 -0700 | [diff] [blame] | 130 | - Improve splitting heuristic more so that if the first argument to a function |
| 131 | call is a data literal that will go over the column limit, then we want to |
| 132 | split before it. |
Bill Wendling | 8d8f512 | 2015-10-16 11:46:23 -0700 | [diff] [blame] | 133 | - Remove spaces around '**' operator. |
Bill Wendling | f8325e6 | 2015-10-16 15:38:54 -0700 | [diff] [blame] | 134 | - Retain formatting of comments in the middle of an expression. |
Bill Wendling | 454cef6 | 2015-10-18 03:49:03 -0700 | [diff] [blame] | 135 | - Don't add a newline to an empty file. |
Bill Wendling | 7ef492b | 2015-10-18 14:43:06 -0700 | [diff] [blame] | 136 | - Over indent a function's parameter list if it's not distinguished from the |
| 137 | body of the function. |
Bill Wendling | c87690c | 2015-10-11 16:45:21 -0700 | [diff] [blame] | 138 | |
Bill Wendling | 2aff7fc | 2015-10-11 14:08:10 -0700 | [diff] [blame] | 139 | ## [0.5.0] 2015-10-11 |
Bill Wendling | d03c99f | 2015-10-08 21:06:07 -0700 | [diff] [blame] | 140 | ### Added |
| 141 | - Add option to exclude files/directories from formatting. |
Bill Wendling | 5c60873 | 2015-10-10 23:39:16 -0700 | [diff] [blame] | 142 | - 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] | 143 | |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 144 | ### Fixed |
| 145 | - Indent the continuation of an if-then statement when it's not distinguished |
| 146 | from the body of the if-then. |
Bill Wendling | 1ce18c7 | 2015-10-10 23:12:16 -0700 | [diff] [blame] | 147 | - Allow for sensible splitting of array indices where appropriate. |
Bill Wendling | be974d8 | 2015-10-11 01:04:00 -0700 | [diff] [blame] | 148 | - Prefer to not split before the ending bracket of an atom. This produces |
| 149 | better code in most cases. |
Bill Wendling | bbd148c | 2015-10-11 01:45:24 -0700 | [diff] [blame] | 150 | - Corrected how horizontal spaces were presevered in a disabled region. |
Bill Wendling | a7e3f50 | 2015-10-08 00:23:40 -0700 | [diff] [blame] | 151 | |
Bill Wendling | 967c3b2 | 2015-10-07 22:20:18 -0700 | [diff] [blame] | 152 | ## [0.4.0] 2015-10-07 |
Ćukasz Langa | 9408987 | 2015-09-22 16:02:26 -0700 | [diff] [blame] | 153 | ### Added |
| 154 | - Support for dedenting closing brackets, "facebook" style. |
| 155 | |
Bill Wendling | 25c8e60 | 2015-10-04 20:48:35 -0700 | [diff] [blame] | 156 | ### Fixed |
| 157 | - Formatting of tokens after a multiline string didn't retain their horizontal |
| 158 | spacing. |
| 159 | |
Bill Wendling | 06865ab | 2015-09-30 01:25:47 -0700 | [diff] [blame] | 160 | ## [0.3.1] 2015-09-30 |
| 161 | ### Fixed |
| 162 | - Format closing scope bracket correctly when indentation size changes. |
| 163 | |
Bill Wendling | a690a62 | 2015-09-20 12:38:50 -0700 | [diff] [blame] | 164 | ## [0.3.0] 2015-09-20 |
| 165 | ### Added |
| 166 | - Return a 2 if the source changed, 1 on error, and 0 for no change. |
| 167 | |
| 168 | ### Fixed |
| 169 | - Make sure we format if the "lines" specified are in the middle of a |
| 170 | statement. |
| 171 | |
Bill Wendling | 9adfa0c | 2015-09-13 05:37:30 -0700 | [diff] [blame] | 172 | ## [0.2.9] - 2015-09-13 |
| 173 | ### Fixed |
| 174 | - Formatting of multiple files. It was halting after formatting the first file. |
| 175 | |
Bill Wendling | dcafd5f | 2015-09-12 15:26:03 -0700 | [diff] [blame] | 176 | ## [0.2.8] - 2015-09-12 |
| 177 | ### Added |
| 178 | - Return a non-zero exit code if the source was changed. |
| 179 | - Add bitwise operator splitting penalty and prefer to split before bitwise |
| 180 | operators. |
| 181 | |
| 182 | ### Fixed |
| 183 | - Retain vertical spacing between disabled and enabled lines. |
| 184 | - Split only at start of named assign. |
| 185 | - Retain comment position when formatting is disabled. |
| 186 | - Honor splitting before or after logical ops. |