Skip to content

Conversation

@pulphix
Copy link

@pulphix pulphix commented Feb 4, 2026

Summary

Adds a new formatter option function-parameter-indent that controls the indentation level of wrapped function and method parameters.
The option lives under [tool.ruff.format] (or [format] in ruff.toml) and accepts "single" (current behavior, default) or "double" (one extra indent level), e.g.:

[tool.ruff.format]
function-parameter-indent = "double"

With "double", multi-line parameter lists for functions, methods, and nested functions are indented one level further than the function body, while lambdas are unchanged.
The option is plumbed through ruff_workspace settings/options, exposed in --show-settings, and documented in the generated schema.

Test Plan

  • Ran RUFF_UPDATE_SCHEMA=1 cargo test at the repo root to update schemas and validate all tests.
  • Verified new formatter behavior via a dedicated unit test in ruff_python_formatter (double-indented async def parameters).
  • Updated and re-ran CLI snapshot tests (cargo test -p ruff --test cli) to cover the new formatter.function_parameter_indent field in --show-settings output.
  • Updated and re-ran show_settings tests to ensure default and nested-directory settings output includes the new option.

@pulphix pulphix requested a review from MichaReiser as a code owner February 4, 2026 11:19
@ntBre
Copy link
Contributor

ntBre commented Feb 4, 2026

Thank you for working on this! However, I will close this PR for the same reason as #19921. As Micha said on #19921, the main blocker to this issue is resolving the questions he raised in #8360 (comment), and we haven't had the chance to resolve those design decisions. The work here and in #19921 is still valuable for the future but isn't actionable at the moment.

@ntBre ntBre closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants