Charlie Marsh
e07670ad97
Add dangling comment handling to dictionary key-value pairs (#7495)
## Summary
This PR fixes a formatting instability by changing the comment handling
around the `:` in a dictionary to mirror that of the `:` in a lambda: we
treat comments around the `:` as dangling, then format them after the
`:`.
Closes https://github.com/astral-sh/ruff/issues/7458.
## Test Plan
`cargo test`
No change in similarity.
Before:
| project | similarity index | total files | changed files |
|--------------|------------------:|------------------:|------------------:|
| cpython | 0.76083 | 1789 | 1631 |
| django | 0.99983 | 2760 | 36 |
| transformers | 0.99956 | 2587 | 404 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99983 | 3496 | 18 |
| warehouse | 0.99929 | 648 | 16 |
| zulip | 0.99969 | 1437 | 21 |
After:
| project | similarity index | total files | changed files |
|--------------|------------------:|------------------:|------------------:|
| cpython | 0.76083 | 1789 | 1631 |
| django | 0.99983 | 2760 | 36 |
| transformers | 0.99956 | 2587 | 404 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99983 | 3496 | 18 |
| warehouse | 0.99929 | 648 | 16 |
| zulip | 0.99969 | 1437 | 21 |
2023-09-19 19:17:21 +00:00
..
2023-09-15 22:49:42 -04:00
2023-09-19 17:29:54 +00:00
2023-09-15 08:46:55 +00:00
2023-08-08 16:51:37 -04:00
2023-09-19 12:27:30 +00:00
2023-09-19 00:01:43 +00:00
2023-09-01 13:56:44 +00:00
2023-09-19 06:29:05 +00:00
2023-07-04 14:27:23 +00:00
2023-09-11 12:28:39 -05:00
2023-09-13 17:55:03 +02:00
2023-09-16 03:21:45 +00:00
2023-09-19 12:01:16 +02:00
2023-09-19 19:17:21 +00:00
2023-09-18 20:57:49 +05:30
2023-08-25 17:42:57 +00:00
2023-09-11 19:12:46 +00:00
2023-08-01 19:29:42 +02:00
2023-09-19 03:37:38 +00:00
2023-09-16 12:21:30 -04:00
2023-09-19 16:06:03 +02:00
2023-09-14 09:40:05 -05:00
2023-09-14 14:35:34 -04:00
2023-08-28 06:44:56 +00:00
2023-09-16 03:21:45 +00:00
2023-09-19 02:18:54 +00:00