I guess the reason the commit fails is because you have a pre-commit job (with ruff) configured? If that´s the case, the solution to your question is to execute first ´pre-commit uninstall´ before retrying to commit.