Charlie Marsh
88c8b47326
Avoid introducing new parentheses in annotated assignments (#8233)
## Summary
We decided to avoid changing this in
https://github.com/astral-sh/ruff/issues/7315, but it's been reported
multiple times (e.g., in https://github.com/astral-sh/ruff/issues/8226,
also on Discord). I suggest we change it to improve compatibility. In
general, it also seems to lend itself to better code style.
Closes #8188
Closes #8226
## Test Plan
Shows improvements for CPython, home-assistant, Poetry, and typeshed.
Before:
| project | similarity index | total files | changed files |
|----------------|------------------:|------------------:|------------------:|
| cpython | 0.75803 | 1799 | 1647 |
| django | 0.99983 | 2772 | 34 |
| home-assistant | 0.99953 | 10596 | 186 |
| poetry | 0.99891 | 317 | 17 |
| transformers | 0.99966 | 2657 | 330 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99978 | 3669 | 20 |
| warehouse | 0.99977 | 654 | 13 |
| zulip | 0.99970 | 1459 | 22 |
After:
| project | similarity index | total files | changed files |
|----------------|------------------:|------------------:|------------------:|
| cpython | 0.75804 | 1799 | 1647 |
| django | 0.99983 | 2772 | 34 |
| home-assistant | 0.99960 | 10596 | 156 |
| poetry | 0.99897 | 317 | 17 |
| transformers | 0.99966 | 2657 | 330 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99980 | 3669 | 18 |
| warehouse | 0.99977 | 654 | 13 |
| zulip | 0.99970 | 1459 | 22 |
2023-10-25 22:51:50 -04:00
..
2023-08-30 04:11:58 +00:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-10-25 20:31:59 -04:00
2023-08-14 12:28:58 +00:00
2023-08-01 08:26:30 +02:00
2023-07-11 16:40:28 +02:00
2023-10-19 09:24:11 +00:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-08-16 15:05:51 +00:00
2023-08-28 08:09:17 +00:00
2023-08-26 14:45:44 +00:00
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-08-15 07:15:33 -04:00
2023-09-01 06:34:51 +00:00
2023-07-31 16:58:15 -04:00
2023-08-30 16:03:17 +02:00
2023-08-30 16:03:17 +02:00
2023-08-14 12:28:58 +00:00
2023-10-15 21:41:50 -04:00
2023-08-14 15:57:36 +00:00
2023-08-31 20:55:05 +00:00
2023-08-31 20:55:05 +00:00
2023-08-31 20:55:05 +00:00
2023-07-11 16:51:24 +02:00
2023-10-18 09:45:58 +00:00
2023-08-04 13:58:01 +00:00
2023-07-26 16:21:23 +00:00
2023-08-15 18:59:18 +00:00
2023-08-30 08:07:11 +00:00
2023-07-10 21:23:49 +02:00
2023-07-19 11:47:56 +00:00
2023-08-15 18:59:18 +00:00
2023-09-01 06:34:51 +00:00
2023-08-24 14:09:25 +02:00
2023-07-31 10:46:40 +02:00
2023-06-30 10:13:23 +02:00
2023-09-19 16:16:40 +02:00
2023-09-18 06:08:10 +00:00
2023-09-18 06:08:10 +00:00
2023-09-18 06:08:10 +00:00
2023-09-18 06:08:10 +00:00
2023-07-11 16:40:28 +02:00
2023-09-14 05:05:37 -04:00
2023-09-18 09:56:41 -04:00
2023-09-12 09:49:51 +02:00
2023-10-25 07:24:06 +01:00
2023-10-22 19:58:25 -04:00
2023-10-19 11:11:17 +02:00
2023-09-28 15:11:33 -04:00
2023-10-19 09:24:11 +00:00
2023-09-14 08:43:53 +00:00
2023-09-19 19:17:21 +00:00
2023-09-19 19:17:21 +00:00
2023-10-11 11:30:34 +00:00
2023-09-24 02:08:44 +00:00
2023-08-30 04:11:58 +00:00
2023-09-19 15:23:51 -04:00
2023-10-18 19:13:58 -04:00
2023-08-25 00:18:05 -04:00
2023-08-21 16:29:26 +02:00
2023-10-15 21:42:00 -04:00
2023-07-20 10:07:22 +00:00
2023-10-19 11:11:17 +02:00
2023-08-11 17:58:42 +00:00
2023-08-16 13:41:07 +00:00
2023-09-28 15:11:33 -04:00
2023-09-14 05:05:37 -04:00
2023-08-30 08:07:11 +00:00
2023-10-22 19:58:25 -04:00
2023-10-19 11:11:17 +02:00
2023-07-21 12:07:51 +00:00
2023-09-16 14:46:56 -04:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-09-19 16:16:40 +02:00
2023-10-26 01:03:34 +00:00
2023-10-26 01:03:34 +00:00
2023-10-25 20:31:59 -04:00
2023-09-19 16:16:40 +02:00
2023-08-14 15:57:36 +00:00
2023-09-19 16:16:40 +02:00
2023-08-31 20:55:05 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-10-04 07:55:01 +00:00
2023-08-17 05:58:19 +00:00
2023-08-25 19:03:37 +00:00
2023-08-17 06:05:41 +00:00
2023-08-17 06:05:41 +00:00
2023-08-21 17:45:23 +02:00
2023-09-25 14:34:59 +00:00
2023-09-11 08:03:59 +00:00
2023-09-11 08:03:59 +00:00
2023-10-18 09:45:58 +00:00
2023-09-21 16:24:42 -04:00
2023-09-04 10:57:04 +01:00
2023-10-19 09:24:11 +00:00
2023-09-12 06:39:57 +00:00
2023-08-23 00:44:33 +00:00
2023-10-24 12:02:27 +00:00
2023-09-19 16:16:40 +02:00
2023-10-25 22:51:50 -04:00
2023-09-20 08:39:25 +02:00
2023-09-19 16:16:40 +02:00
2023-09-16 16:21:45 +02:00
2023-07-13 10:51:25 +00:00
2023-06-26 14:15:55 +02:00
2023-10-25 20:31:59 -04:00
2023-08-30 08:07:11 +00:00
2023-08-23 14:01:14 +00:00
2023-10-19 11:11:17 +02:00
2023-10-12 17:50:12 +02:00
2023-08-02 19:55:00 +00:00
2023-10-19 11:11:17 +02:00
2023-10-11 11:35:41 +00:00
2023-10-11 11:35:41 +00:00
2023-10-22 19:58:33 -04:00
2023-09-17 14:56:41 +00:00
2023-08-02 19:55:00 +00:00
2023-08-15 18:59:18 +00:00
2023-09-20 16:20:22 -04:00
2023-08-29 08:30:05 +02:00
2023-08-15 09:33:57 +02:00
2023-08-21 09:02:23 +02:00
2023-10-19 11:11:17 +02:00
2023-10-24 12:02:27 +00:00
2023-10-19 11:11:17 +02:00
2023-10-19 09:24:11 +00:00
2023-09-11 08:03:59 +00:00
2023-09-11 08:03:59 +00:00
2023-09-11 08:03:59 +00:00
2023-09-11 08:03:59 +00:00
2023-09-19 16:16:40 +02:00
2023-09-28 18:55:19 +00:00
2023-10-19 11:11:17 +02:00