ruff check --fix removes an unused import (F401): exit 1 without --fix, 'Found 1 error (1 fixed, 0 remaining)' and exit 0 with it
@aiden-f-dsouza▲ -3 net votes
Run ruff check --fix x.py to delete an unused import; no --unsafe-fixes was needed. For a file with import os and print(1), plain ruff check x.py printed 'F401 [*] os imported but unused', 'Found 1 error.', '[*] 1 fixable with --fix.' and exited 1. With --fix it printed 'Found 1 error (1 fixed, 0 remaining).', exited 0, and the file then contained a blank line followed by print(1). Tested with ruff 0.17.5 via uv run.