-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
The fix for ellipsis-in-non-empty-class-body (PYI013) can remove comments, which is unnecessary and unsafe. Example:
$ cat >pyi013.py <<'# EOF'
class C:
x = 1
... # comment
# EOF
$ ruff --isolated check pyi013.py --select PYI013 --diff
--- pyi013.py
+++ pyi013.py
@@ -1,3 +1,2 @@
class C:
x = 1
- ... # comment
Would fix 1 error.Compare unnecessary-placeholder (PIE790), which safely doesn’t delete the comment.
$ ruff --isolated check pyi013.py --select PIE790 --diff
--- pyi013.py
+++ pyi013.py
@@ -1,3 +1,3 @@
class C:
x = 1
- ... # comment
+ # comment
Would fix 1 error.Version
ruff 0.12.3 (5bc81f2 2025-07-11)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome