ruff/crates
Charlie Marsh 7f1456a2c9
Allow up to two newlines before trailing clause body comments (#7575)
## Summary

This is the peer to https://github.com/astral-sh/ruff/pull/7557, but for
"leading" clause comments, like:

```python
if True:
    pass


# comment
else:
    pass
```

In this case, we again want to allow up to two newlines at the top
level.

## Test Plan

`cargo test`

No changes.

Before:

| project | similarity index | total files | changed files |

|--------------|------------------:|------------------:|------------------:|
| cpython | 0.76083 | 1789 | 1631 |
| django | 0.99983 | 2760 | 36 |
| transformers | 0.99963 | 2587 | 323 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99979 | 3496 | 22 |
| warehouse | 0.99967 | 648 | 15 |
| zulip | 0.99972 | 1437 | 21 |

After:

| project | similarity index | total files | changed files |

|--------------|------------------:|------------------:|------------------:|
| cpython | 0.76083 | 1789 | 1631 |
| django | 0.99983 | 2760 | 36 |
| transformers | 0.99963 | 2587 | 323 |
| twine | 1.00000 | 33 | 0 |
| typeshed | 0.99979 | 3496 | 22 |
| warehouse | 0.99967 | 648 | 15 |
| zulip | 0.99972 | 1437 | 21 |
2023-09-21 14:52:38 +00:00
..
flake8_to_ruff Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
ruff_benchmark Introduce LinterSettings 2023-09-20 17:02:34 +02:00
ruff_cache Introduce FormatterSettings (#7545) 2023-09-21 08:01:24 +02:00
ruff_cli Bump rayon from 1.7.0 to 1.8.0 (#7564) 2023-09-21 11:52:41 +02:00
ruff_dev Bump rayon from 1.7.0 to 1.8.0 (#7564) 2023-09-21 11:52:41 +02:00
ruff_diagnostics Create ruff_notebook crate (#7039) 2023-09-01 13:56:44 +00:00
ruff_formatter Introduce FormatterSettings (#7545) 2023-09-21 08:01:24 +02:00
ruff_index
ruff_linter Detect asyncio.get_running_loop calls in RUF006 (#7562) 2023-09-21 04:37:38 +00:00
ruff_macros Unify Settings and AllSettings (#7532) 2023-09-20 13:56:07 +00:00
ruff_notebook chore: Upgrade pyproject-toml crate (#7335) 2023-09-13 17:55:03 +02:00
ruff_python_ast Treat parameters-with-newline as empty in function formatting (#7550) 2023-09-20 16:20:22 -04:00
ruff_python_codegen Fix stylist indentation with a formfeed (#7489) 2023-09-19 12:01:16 +02:00
ruff_python_formatter Allow up to two newlines before trailing clause body comments (#7575) 2023-09-21 14:52:38 +00:00
ruff_python_index Remove triple-quoted string ranges computation (#7476) 2023-09-18 20:57:49 +05:30
ruff_python_literal
ruff_python_parser Add range to lexer test snapshots (#7265) 2023-09-11 19:12:46 +00:00
ruff_python_resolver
ruff_python_semantic Detect asyncio.get_running_loop calls in RUF006 (#7562) 2023-09-21 04:37:38 +00:00
ruff_python_stdlib [flake8-logging] Implement LOG002: invalid-get-logger-argument (#7399) 2023-09-16 12:21:30 -04:00
ruff_python_trivia Tokenizer: Emit only a single bogus token (#7425) 2023-09-19 16:06:03 +02:00
ruff_shrinking Bump shlex from 1.1.0 to 1.2.0 (#7381) 2023-09-14 09:40:05 -05:00
ruff_source_file Use dot references in docs for methods (#7391) 2023-09-14 14:35:34 -04:00
ruff_text_size Unify line size settings between ruff and the formatter (#6873) 2023-08-28 06:44:56 +00:00
ruff_wasm Introduce FormatterSettings (#7545) 2023-09-21 08:01:24 +02:00
ruff_workspace Introduce FormatterSettings (#7545) 2023-09-21 08:01:24 +02:00