ruff/crates/ruff_python_formatter/src
Gautier Moin a067d87ccc
Fix incorrect Parameter range for *args and **kwargs (#10283)
## Summary

Fix #10282 

This PR updates the Python grammar to include the `*` character in
`*args` `**kwargs` in the range of the `Parameter`
```
def f(*args, **kwargs): pass
#      ~~~~    ~~~~~~    <-- range before the PR
#     ^^^^^  ^^^^^^^^    <-- range after
```

The invalid syntax `def f(*, **kwargs): ...` is also now correctly
reported.

## Test Plan

Test cases were added to `function.rs`.
2024-03-08 18:57:49 -05:00
..
comments Fix incorrect Parameter range for *args and **kwargs (#10283) 2024-03-08 18:57:49 -05:00
expression Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
module Attach dangling comments to the comprehension instead of the if or iter nodes (#7693) 2023-09-29 10:45:01 +01:00
other Formatter: Improve single-with item formatting for Python 3.8 or older (#10276) 2024-03-08 23:56:02 +00:00
pattern New Singleton enum for PatternMatchSingleton node (#8063) 2023-10-30 05:48:53 +00:00
snapshots Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
statement Formatter: Improve single-with item formatting for Python 3.8 or older (#10276) 2024-03-08 23:56:02 +00:00
string Ruff 2024.2 style (#9639) 2024-02-29 09:30:54 +01:00
type_param Don't move type param opening parenthesis comment (#8163) 2023-10-24 12:02:27 +00:00
builders.rs Refactor with statement formatting to have explicit layouts (#10296) 2024-03-08 18:40:39 -05:00
cli.rs Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
context.rs Ruff 2024.2 style (#9639) 2024-02-29 09:30:54 +01:00
generated.rs Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
lib.rs Implement RUF028 to detect useless formatter suppression comments (#9899) 2024-02-28 19:21:06 +00:00
main.rs Formatter and parser refactoring (#7569) 2023-09-26 15:29:43 +02:00
options.rs Preview minimal f-string formatting (#9642) 2024-02-16 20:28:11 +05:30
prelude.rs Accept any Into<AnyNodeRef> as Comments arguments (#5205) 2023-06-20 16:49:21 +00:00
preview.rs Formatter: Improve single-with item formatting for Python 3.8 or older (#10276) 2024-03-08 23:56:02 +00:00
range.rs Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
shared_traits.rs ruff_python_formatter: copy and inline shared traits (#8656) 2023-11-13 12:16:04 -05:00
verbatim.rs Preview minimal f-string formatting (#9642) 2024-02-16 20:28:11 +05:30