ruff/crates/ruff_workspace/src
Jake Park c03a693ebc
[pylint] Implement consider-using-ternary (R1706) (#7811)
This is my first PR. Please feel free to give me any feedback for even
small drawbacks.

## Summary

Checks if pre-python 2.5 ternary syntax is used.

Before
```python
x, y = 1, 2
maximum = x >= y and x or y  # [consider-using-ternary]
```

After
```python
x, y = 1, 2
maximum = x if x >= y else y
```

References: 

[pylint](https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/consider-using-ternary.html)
#970 
[and_or_ternary distinction
logic](https://github.com/pylint-dev/pylint/blob/main/pylint/checkers/refactoring/refactoring_checker.py#L1813)

## Test Plan

Unit test, python file, snapshot added.
2023-10-13 01:29:19 +00:00
..
configuration.rs [pylint] Implement consider-using-ternary (R1706) (#7811) 2023-10-13 01:29:19 +00:00
lib.rs Add most formatter options to ruff.toml / pyproject.toml (#7566) 2023-09-22 15:47:57 +00:00
options.rs Drop formatting specific rules from the default set (#7900) 2023-10-11 11:29:34 -05:00
options_base.rs Support option group documentation (#7593) 2023-09-22 16:31:52 +00:00
pyproject.rs Add lint section to Ruff configuration 2023-09-27 08:46:27 +02:00
resolver.rs Add most formatter options to ruff.toml / pyproject.toml (#7566) 2023-09-22 15:47:57 +00:00
settings.rs Update CLI to respect fix applicability (#7769) 2023-10-06 03:41:43 +00:00