Skip to content

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jun 8, 2023
1 parent be0312e commit 2f36ae7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/ruff_python_formatter/src/other/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ impl FormatNodeRule<Arg> for FormatArg {
} = item;
write!(
f,
[source_text_slice(
TextRange::at(range.start(), arg.text_len()),
ContainsNewlines::No
)]
[
// The name of the argument
source_text_slice(
TextRange::at(range.start(), arg.text_len()),
ContainsNewlines::No
)
]
)?;

if let Some(annotation) = annotation {
Expand Down
1 change: 1 addition & 0 deletions crates/ruff_python_formatter/src/other/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ impl FormatNodeRule<Arguments> for FormatArguments {

write!(f, [if_group_breaks(&text(","))])?;

// Expand the group if the source has a trailing *magic* comma.
if let Some(last_node) = last_node {
let ends_with_pos_only_argument_separator = !posonlyargs.is_empty()
&& args.is_empty()
Expand Down

0 comments on commit 2f36ae7

Please sign in to comment.