Is your feature request related to a problem? Please describe.
I tend to press "reformat" a lot out of habit and sometimes I've written a line where I create a new variable but haven't used it yet. ruff --fix
removes that variable (rule F841):
x = fun()
gets turned into
fun()
Describe the solution you'd like
I would like to disable the rule responsible for this (F841), but keep it on the cli where I want to run ruff via pre-commit which should remove any unused code/variables. E.g. by running it via ruff check --fix --unfixable F841
.
Describe alternatives you've considered
Not running ruff on reformat. Add another config in the project which has these rules disabled and configure this in the editor config.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too