mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Fix D204 when there's a semicolon after a docstring (#7174)
## Summary Another statement on the same line as the docstring would previous make the D204 (newline after docstring) fix fail: ```python class StatementOnSameLineAsDocstring: "After this docstring there's another statement on the same line separated by a semicolon." ;priorities=1 def sort_services(self): pass ``` The fix handles this case manually: ```python class StatementOnSameLineAsDocstring: "After this docstring there's another statement on the same line separated by a semicolon." priorities=1 def sort_services(self): pass ``` Fixes #7088 ## Test Plan Added a new `D` test case
This commit is contained in:
parent
878813f277
commit
babf8d718e
8 changed files with 224 additions and 11 deletions
|
@ -32,6 +32,7 @@ impl UniversalNewlines for str {
|
|||
/// assert_eq!(lines.next_back(), Some(Line::new("\r\n", TextSize::from(8))));
|
||||
/// assert_eq!(lines.next(), None);
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct UniversalNewlineIterator<'a> {
|
||||
text: &'a str,
|
||||
offset: TextSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue