Format UnaryExpr

<!--
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 adds basic formatting for unary expressions.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

I added a new `unary.py` with custom test cases
This commit is contained in:
Micha Reiser 2023-06-21 10:09:47 +02:00 committed by GitHub
parent 3973836420
commit 1336ca601b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 623 additions and 115 deletions

View file

@ -411,11 +411,10 @@ Formatted twice:
#[test]
fn quick_test() {
let src = r#"
def foo(
b=3
+ 2 # comment
):
if [
aaaaaa,
BBBB,ccccccccc,ddddddd,eeeeeeeeee,ffffff
] & bbbbbbbbbbbbbbbbbbddddddddddddddddddddddddddddbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:
...
"#;
// Tokenize once