ruff/crates/ruff_python_formatter/src
Charlie Marsh adc8bb7821
Rename Arguments to Parameters in the AST (#6253)
## Summary

This PR renames a few AST nodes for clarity:

- `Arguments` is now `Parameters`
- `Arg` is now `Parameter`
- `ArgWithDefault` is now `ParameterWithDefault`

For now, the attribute names that reference `Parameters` directly are
changed (e.g., on `StmtFunctionDef`), but the attributes on `Parameters`
itself are not (e.g., `vararg`). We may revisit that decision in the
future.

For context, the AST node formerly known as `Arguments` is used in
function definitions. Formally (outside of the Python context),
"arguments" typically refers to "the values passed to a function", while
"parameters" typically refers to "the variables used in a function
definition". E.g., if you Google "arguments vs parameters", you'll get
some explanation like:

> A parameter is a variable in a function definition. It is a
placeholder and hence does not have a concrete value. An argument is a
value passed during function invocation.

We're thus deviating from Python's nomenclature in favor of a scheme
that we find to be more precise.
2023-08-01 13:53:28 -04:00
..
comments Rename Arguments to Parameters in the AST (#6253) 2023-08-01 13:53:28 -04:00
expression Rename Arguments to Parameters in the AST (#6253) 2023-08-01 13:53:28 -04:00
module Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00
other Rename Arguments to Parameters in the AST (#6253) 2023-08-01 13:53:28 -04:00
pattern Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
snapshots Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
statement Implement Black's rules around newlines before and after class docstrings (#6209) 2023-08-01 13:33:01 -04:00
builders.rs formatter: WithNodeLevel helper (#6212) 2023-07-31 21:22:17 +00:00
cli.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
context.rs formatter: WithNodeLevel helper (#6212) 2023-07-31 21:22:17 +00:00
generated.rs Rename Arguments to Parameters in the AST (#6253) 2023-08-01 13:53:28 -04:00
lib.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
main.rs Add a formatter CLI for debugging (#4809) 2023-06-05 07:33:33 +00:00
options.rs Prefer the configured quote style 2023-06-26 14:24:25 +02:00
prelude.rs Accept any Into<AnyNodeRef> as Comments arguments (#5205) 2023-06-20 16:49:21 +00:00