ruff
ruff copied to clipboard
--add-noqa adds duplicated noqa comment
$ cat foo.py
from foo import ( # noqa: F401
bar
)
$ ruff --select F401 --add-noqa foo.py
Added 1 noqa directives.
$ cat foo.py
from foo import ( # noqa: F401
bar # noqa: F401
)
Ah thank you. I probably didn't extend --add-noqa to handle those "parent-style" comments when we added support for them.
Does --select RUF100 --fix remove the dupe? (Still a bug.)
yes, ruff --select RUF100,F401 --fix foo.py restores the original version