ruff/crates/ruff_python_formatter/resources/test/fixtures/ruff
konsti 3944c42d4c
Format comment before parameter default correctly (#7870)
**Summary** Handle comment before the default values of function
parameters correctly by inserting a line break instead of space after
the equals sign where required.

```python
def f(
    a = # parameter trailing comment; needs line break
    1,
    b =
    # default leading comment; needs line break
    2,
    c = ( # the default leading can only be end-of-line with parentheses; no line break
        3
    ),
    d = (
        # own line leading comment with parentheses; no line break
        4
    )
)
```

Fixes #7603

**Test Plan** Added the different cases and one more complex case as
fixtures.
2023-10-12 17:50:12 +02:00
..
carriage_return Normalize '\r' in string literals to '\n' 2023-06-30 10:13:23 +02:00
expression Formatter quoting for f-strings with triple quotes (#7826) 2023-10-11 11:30:34 +00:00
fmt_on_off Add most formatter options to ruff.toml / pyproject.toml (#7566) 2023-09-22 15:47:57 +00:00
fmt_skip Use correct start location for class/function clause header (#7802) 2023-10-04 07:55:01 +00:00
parentheses Preserve parentheses around partial call chains (#7109) 2023-09-04 10:57:04 +01:00
statement Format comment before parameter default correctly (#7870) 2023-10-12 17:50:12 +02:00
stub_files Format empty lines in stub files like black's preview style (#7206) 2023-09-11 08:03:59 +00:00
.editorconfig Indent statements in suppressed ranges (#6507) 2023-08-15 08:00:35 +02:00
docstring.options.json Add most formatter options to ruff.toml / pyproject.toml (#7566) 2023-09-22 15:47:57 +00:00
docstring.py Format docstrings (#6452) 2023-08-14 12:28:58 +00:00
empty_multiple_trailing_newlines.py Fix handling of newlines in empty files (#7473) 2023-09-18 06:08:10 +00:00
empty_now_newline.py Fix handling of newlines in empty files (#7473) 2023-09-18 06:08:10 +00:00
empty_trailing_newline.py Fix handling of newlines in empty files (#7473) 2023-09-18 06:08:10 +00:00
empty_whitespace.py Fix handling of newlines in empty files (#7473) 2023-09-18 06:08:10 +00:00
form_feed.py Treat form feed as whitespace in SimpleTokenizer (#7626) 2023-09-25 14:34:59 +00:00
module_dangling_comment1.py Format empty lines in stub files like black's preview style (#7206) 2023-09-11 08:03:59 +00:00
module_dangling_comment2.py Format empty lines in stub files like black's preview style (#7206) 2023-09-11 08:03:59 +00:00
newlines.py Treat empty-line separated comments as trailing statement comments (#6999) 2023-08-31 20:55:05 +00:00
newlines.pyi Truncate to one empty line in stub files (#7558) 2023-09-21 16:24:42 -04:00
skip_magic_trailing_comma.options.json Add tests for skip magic trailing comma 2023-06-26 14:15:55 +02:00
skip_magic_trailing_comma.py Improve with statement comment handling and expression breaking (#6621) 2023-08-18 03:30:38 +00:00
tab_width.options.json Introduce IndentWidth (#7301) 2023-09-13 14:52:24 +02:00
tab_width.py Introduce IndentWidth (#7301) 2023-09-13 14:52:24 +02:00
trailing_comments.py Extend pragma comment cases (#7687) 2023-09-28 18:55:19 +00:00
trivia.py Correctly handle newlines after/before comments (#4895) 2023-06-07 14:49:43 +02:00