-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
breakingBreaking API changeBreaking API changecliRelated to the command-line interfaceRelated to the command-line interfacehelp wantedContributions especially welcomeContributions especially welcome
Description
This task is part of #4181 and depends on #4183. The goal is to change the CLI to respect the Fix::applicability.
- Change
--fixto only applyApplicability::Safefixes. Print a message with the number of fixes that were skipped because they have anApplicabilityother thanSafeand print the number at the end. - Add a new
--fix-unsafeCLI option that applies all fixes - Change
--diffand--fix-onlyto imply--fixbut runs all fixes if the user also provides--fix-unsafe.
Considerations
- We may want to hold off with this change until we've categorized a significant part of the fixes (see Categorise
fixesassafeormaybe_incorrect#4184). - I recommend introducing a new
--fix-unsafeto apply unsafe fixes of past experience at Rome. Rome used to apply all fixes with--fixbut we got multiple reports from users that they did not expect Rome to make changes that may change the program's semantic. That's why we decided to rename the CLI option to--applyand--apply-unsafeto make it clear, that the latter applies fixes that may be incorrect. The downside of not running all fixes with--fixis that I expect that some users may be confused why ruff doesn't apply all fixes when running--fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breakingBreaking API changeBreaking API changecliRelated to the command-line interfaceRelated to the command-line interfacehelp wantedContributions especially welcomeContributions especially welcome