You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file content(at least simple cpython script shows that this is valid python file):
class ServiceSorter(ABC):
def sort_services(self,services):0
class DefaultPrioritySorter(ServiceSorter):
'Default service sorting approach that always give S3 the highest priority.';priorities={'s3':100,'lambda':1}
def sort_services(A,services):return sorted(services,key=lambda k:A.priorities.get(k,0),reverse=True)
error
/home/rafal/test/tmp_folder/39521.py:4:2: D204 1 blank line required after class docstring
Found 1 error.
error: Autofix introduced a syntax error. Reverting all changes.
This indicates a bug in `ruff`. If you could open an issue at:
https://github.com/astral-sh/ruff/issues/new?title=%5BAutofix%20error%5D
...quoting the contents of `/home/rafal/test/tmp_folder/39521.py`, the rule codes D204, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!
## 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
Ruff 0.0.287 (latest changes from main branch)
file content(at least simple cpython script shows that this is valid python file):
error
python_compressed.zip
The text was updated successfully, but these errors were encountered: