-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
fixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
The fix for SIM910 will delete comments inside the get. If there are comments, they should be moved, the fix should be marked unsafe, or the fix should not apply. playground
PS ~\Desktop\New_folder>Get-Content issue.py
ages = {"Tom": 23, "Maria": 23, "Dog": 11}
age = ages.get( #1
"Cat" #2
, #3
None #4
# 5
)PS ~\Desktop\New_folder>uvx ruff check issue.py --isolated --select SIM --fix --diff
--- issue.py
+++ issue.py
@@ -1,7 +1,2 @@
ages = {"Tom": 23, "Maria": 23, "Dog": 11}
-age = ages.get( #1
-"Cat" #2
-, #3
-None #4
-# 5
-)
+age = ages.get("Cat")
Would fix 1 error.This also applies to SIM911 playground
Version
ruff 0.12.0 (87f0feb 2025-06-17) + playground
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fixesRelated to suggested fixes for violationsRelated to suggested fixes for violationshelp wantedContributions especially welcomeContributions especially welcome