mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Preserve parentheses around left side of binary 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 fixes an issue where the binary expression formatting removed parentheses around the left hand side of an expression. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan I added a new regression test and re-ran the ecosystem check. It brings down the `check-formatter-stability` output from a 3.4MB file down to 900KB. <!-- How was it tested? -->
This commit is contained in:
parent
ae25638b0b
commit
9c2a75284b
5 changed files with 41 additions and 19 deletions
|
@ -205,3 +205,9 @@ if (
|
|||
# Unstable formatting in https://github.com/realtyem/synapse-unraid/blob/unraid_develop/synapse/handlers/presence.py
|
||||
for user_id in set(target_user_ids) - {u.user_id for u in updates}:
|
||||
updates.append(UserPresenceState.default(user_id))
|
||||
|
||||
# Keeps parenthesized left hand sides
|
||||
(
|
||||
log(self.price / self.strike)
|
||||
+ (self.risk_free - self.div_cont + 0.5 * (self.sigma**2)) * self.exp_time
|
||||
) / self.sigmaT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue