[pycodestyle] Preserve original value format (E731) (#15097)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
InSync 2024-12-23 16:29:46 +07:00 committed by GitHub
parent 03bb9425df
commit 9eb73cb7e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 170 additions and 31 deletions

View file

@ -156,3 +156,24 @@ from typing import Callable
class FilterDataclass:
# OK
filter: Callable[[str], bool] = lambda _: True
# Regression tests for:
# * https://github.com/astral-sh/ruff/issues/7720
x = lambda: """
a
b
"""
# * https://github.com/astral-sh/ruff/issues/10277
at_least_one_million = lambda _: _ >= 1_000_000
x = lambda: (
# comment
5 + 10
)
x = lambda: (
# comment
y := 10
)