Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FURB171: Auto-fix deletes comments #10063

Open
mrcljx opened this issue Feb 20, 2024 · 1 comment · May be fixed by #15521
Open

FURB171: Auto-fix deletes comments #10063

mrcljx opened this issue Feb 20, 2024 · 1 comment · May be fixed by #15521
Labels
bug Something isn't working fixes Related to suggested fixes for violations

Comments

@mrcljx
Copy link

mrcljx commented Feb 20, 2024

answer = 1
test = answer in (
  # needs special handling
  42,
)
ruff --fix --isolated --preview --select FURB171 file.py

Result (comment is gone)

answer = 1
test = answer == 42

Ruff Version: 0.2.2

@charliermarsh charliermarsh added bug Something isn't working fixes Related to suggested fixes for violations labels Feb 20, 2024
@charliermarsh
Copy link
Member

We're still deciding on our policy (overall) towards preserving comments and how that interacts with fix safety: #9790. We can probably fix this particular case though.

@InSyncWithFoo InSyncWithFoo linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants