-
Notifications
You must be signed in to change notification settings - Fork 24
Description
With the introduction of the unsafe
auto-fixes in ruff, I feel having a single toggle in pylsp for enabling/disabling them are quite too inefficient or "too safe", as either make all unsafe fixes disappear, or making the Fix all
-code action quite unsafe in nature
My idea is instead, if you leave pylsp.plugins.ruff.unsafeFixes
as False
then the Fix all
-code-action should fix all safe
rules, but still make the individual unsafe
rules available and actionable on the respective diagnostic/location
This strikes the balance of being safe with the Fix all
-code-action, and still being able to discover and make a choice on the unsafe
fix
(If you instead set pylsp.plugins.ruff.unsafeFixes
to True
, then the plugin should work exactly as now (because then you signed up for the "unsafety-ness"))
With that being said, the unsafe
-code actions should probably indicate they are unsafe somehow
If this isn't too crazy of an idea, I'd happily try to implement it :-)