ruff/crates
konsti 0b9af031fb
Format ExprIfExp (ternary operator) (#5597)
## Summary

Format `ExprIfExp`, also known as the ternary operator or inline `if`.
It can look like
```python
a1 = 1 if True else 2
```
but also
```python
b1 = (
    # We return "a" ...
    "a" # that's our True value
    # ... if this condition matches ...
    if True # that's our test
    # ... otherwise we return "b§
    else "b" # that's our False value
)
```

This also fixes a visitor order bug.

The jaccard index on django goes from 0.911 to 0.915.

## Test Plan

I added fixtures without and with comments in strange places.
2023-07-07 19:11:52 +00:00
..
flake8_to_ruff Bump version to 0.0.277 (#5515) 2023-07-04 17:31:32 -04:00
ruff Implement PYI030: Unnecessary literal union (#5570) 2023-07-07 16:43:10 +00:00
ruff_benchmark Create PyFormatOptions 2023-06-26 14:02:17 +02:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Extend ruff_dev formatter script to compute statistics and format a project (#5492) 2023-07-07 11:30:12 +00:00
ruff_dev Check formatter stability on CI (#5446) 2023-07-07 18:28:36 +02:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Show BestFitting mode if it isn't FirstLine (#5452) 2023-06-30 09:49:00 +00:00
ruff_index Add unreachable code rule (#5384) 2023-07-04 14:27:23 +00:00
ruff_macros Fix remaining Copyright rule references (#5577) 2023-07-07 02:49:19 +00:00
ruff_python_ast Format ExprIfExp (ternary operator) (#5597) 2023-07-07 19:11:52 +00:00
ruff_python_formatter Format ExprIfExp (ternary operator) (#5597) 2023-07-07 19:11:52 +00:00
ruff_python_resolver Format let-else with rustfmt nightly (#5461) 2023-07-03 02:13:35 +00:00
ruff_python_semantic Differentiate between runtime and typing-time annotations (#5575) 2023-07-07 00:21:44 -04:00
ruff_python_stdlib Remove some additional manual iterator matches (#5482) 2023-07-03 16:29:59 +00:00
ruff_python_whitespace Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm [pyupgrade] Restore the keep-runtime-typing setting (#5470) 2023-07-03 02:11:31 +00:00