Micha Reiser
30bec3fcfa
Only omit optinal parens if the expression ends or starts with a parenthesized expression
...
<!--
Thank you for contributing to Ruff! To help us out with reviewing, please consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->
## Summary
This PR matches Black' behavior where it only omits the optional parentheses if the expression starts or ends with a parenthesized expression:
```python
a + [aaa, bbb, cccc] * c # Don't omit
[aaa, bbb, cccc] + a * c # Split
a + c * [aaa, bbb, ccc] # Split
```
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
This improves the Jaccard index from 0.945 to 0.946
2023-07-11 17:05:25 +02:00
..
2023-07-07 19:11:52 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:40:28 +02:00
2023-07-11 06:08:08 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:40:28 +02:00
2023-07-11 16:40:28 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:51:24 +02:00
2023-07-11 13:16:18 +00:00
2023-07-11 13:16:18 +00:00
2023-07-11 16:40:28 +02:00
2023-07-10 12:32:15 +00:00
2023-07-10 12:32:15 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:40:28 +02:00
2023-07-11 09:06:23 +02:00
2023-06-30 06:32:50 +00:00
2023-07-03 21:48:44 +02:00
2023-07-10 12:32:15 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 06:08:08 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 13:16:18 +00:00
2023-06-30 06:32:50 +00:00
2023-07-04 07:07:20 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:51:24 +02:00
2023-07-04 07:07:20 +00:00
2023-07-11 06:08:08 +00:00
2023-06-30 06:32:50 +00:00
2023-07-04 07:07:20 +00:00
2023-07-11 14:07:39 +02:00
2023-07-11 14:07:39 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 14:07:39 +02:00
2023-07-11 16:40:28 +02:00
2023-07-04 07:07:20 +00:00
2023-06-30 06:32:50 +00:00
2023-07-03 21:48:44 +02:00
2023-07-03 21:48:44 +02:00
2023-07-11 16:40:28 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:51:24 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-07-04 07:07:20 +00:00
2023-07-11 16:51:24 +02:00
2023-07-04 07:07:20 +00:00
2023-07-11 16:51:24 +02:00
2023-07-11 14:07:39 +02:00
2023-07-10 21:23:49 +02:00
2023-07-11 13:16:18 +00:00
2023-07-04 07:07:20 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 16:40:28 +02:00
2023-07-11 13:16:18 +00:00
2023-06-30 06:32:50 +00:00
2023-07-11 14:07:39 +02:00
2023-07-11 14:07:39 +02:00
2023-07-11 14:07:39 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 06:32:50 +00:00
2023-06-30 10:13:23 +02:00
2023-07-11 16:40:28 +02:00
2023-07-04 07:07:20 +00:00
2023-07-11 14:07:39 +02:00
2023-06-27 09:29:40 +00:00
2023-07-11 16:51:24 +02:00
2023-07-11 14:07:39 +02:00
2023-07-08 12:33:18 +02:00
2023-07-10 15:55:19 +02:00
2023-07-11 16:51:24 +02:00
2023-07-03 21:48:44 +02:00
2023-07-10 12:32:15 +00:00
2023-06-27 09:29:40 +00:00
2023-07-11 06:08:08 +00:00
2023-07-08 12:33:18 +02:00
2023-07-10 21:23:49 +02:00
2023-07-11 14:07:39 +02:00
2023-07-08 12:33:18 +02:00
2023-07-11 09:06:23 +02:00
2023-06-26 14:15:55 +02:00
2023-06-26 14:15:55 +02:00
2023-06-29 08:09:26 +02:00
2023-07-11 08:36:26 +02:00
2023-06-26 14:15:55 +02:00
2023-06-26 14:15:55 +02:00
2023-06-26 14:15:55 +02:00
2023-07-04 07:07:20 +00:00
2023-07-04 07:07:20 +00:00
2023-07-11 14:07:39 +02:00
2023-07-06 18:23:53 +00:00
2023-06-27 09:29:40 +00:00
2023-07-11 06:08:08 +00:00
2023-06-26 14:15:55 +02:00