ruff/crates/ruff_source_file/src
Charlie Marsh 45937426c7
Fix blank-line docstring rules for module-level docstrings (#9878)
## Summary

Given:

```python
"""Make a summary line.

Note:
----
  Per the code comment the next two lines are blank. "// The first blank line is the line containing the closing
      triple quotes, so we need at least two."

"""
```

It turns out we excluded the line ending in `"""`, because it's empty
(unlike for functions, where it consists of the indent). This PR changes
the `following_lines` iterator to always include the trailing newline,
which gives us correct and consistent handling between function and
module-level docstrings.

Closes https://github.com/astral-sh/ruff/issues/9877.
2024-02-07 16:48:28 -05:00
..
lib.rs Add cell indexes to all diagnostics (#9387) 2024-01-04 14:02:23 +00:00
line_index.rs Add --range option to ruff format (#9733) 2024-02-05 19:21:45 +00:00
locator.rs Skip BOM when inserting start-of-file imports (#7622) 2023-09-23 19:36:50 +00:00
newlines.rs Fix blank-line docstring rules for module-level docstrings (#9878) 2024-02-07 16:48:28 -05:00