Summary
The fix for explicit-f-string-type-conversion (RUF010) should be marked unsafe when it deletes a comment. Example:
$ cat >ruf010.py <<'# EOF'
f"{ascii(
# comment
1
)}"
# EOF
$ ruff --isolated check ruf010.py --select RUF010 --fix
Found 1 error (1 fixed, 0 remaining).
$ cat ruf010.py
f"{1!a}"
When the modified code includes a comment and the comment is preserved, the fix should continue to be marked safe. Example:
f"{ascii((
# comment
1
))}"
Version
ruff 0.12.7 (c5ac998 2025-07-29)
Summary
The fix for
explicit-f-string-type-conversion(RUF010) should be marked unsafe when it deletes a comment. Example:When the modified code includes a comment and the comment is preserved, the fix should continue to be marked safe. Example:
Version
ruff 0.12.7 (c5ac998 2025-07-29)