Fix leading comment formatting for lambdas with multiple parameters by ntBre · Pull Request #21879 · astral-sh/ruff (original) (raw)
added 2 commits
the new leading comment is causing the whole Parameters list to break. these cases should instead format like:
(
lambda
# comment
*x, **y: x
)
(
lambda
# comment 2
*x, **y: x
)without line breaks in the parameter list
and fix some names
the start check handles both the are_parameters_parenthesized check (because
lambda parameters cannot be parenthesized and thus nothing can come between the
start of the parameters and the first parameter) and the comparison with
first.range() since the parameters start where the first parameter starts
I believe parameters itself would be None if there were no next parameter
ntBre marked this pull request as ready for review
ntBre deleted the brent/fix-kwargs branch
dcreager added a commit that referenced this pull request
- origin/main: (33 commits)
[ty] Simplify union lower bounds and intersection upper bounds in constraint sets (#21871)
[ty] Collapse
neverpaths in constraint set BDDs (#21880) Fix leading comment formatting for lambdas with multiple parameters (#21879) [ty] Type inference for@asynccontextmanager(#21876) Fix comment placement in lambda parameters (#21868) [pylint] Detect subclasses of builtin exceptions (PLW0133) (#21382) Fix stack overflow with recursive generic protocols (depth limit) (#21858) New diagnostics for unused range suppressions (#21783) [ty] Use default settings in completion tests [ty] Infer type variables within generic unions (#21862) [ty] Fix overload filtering to prefer more "precise" match (#21859) [ty] Stabilize auto-import [ty] Fix reveal-type E2E test (#21865) [ty] Use concise message for LSP clients not supporting related diagnostic information (#21850) Include more details in Tokens 'offset is inside token' panic message (#21860) apply range suppressions to filter diagnostics (#21623) [ty] followup: add-import action forreveal_typetoo (#21668) [ty] Enrich function argument auto-complete suggestions with annotated types [ty] Add autocomplete suggestions for function arguments [flake8-bugbear] Accept immutable slice default arguments (B008) (#21823) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})