Skip to content

How to migrate existing merge requests to auto-formatted code

  1. Fetch the latest changes.
git fetch
  1. Merge or rebase the changes before the auto-formatter commit. There might be conflicts at this stage, carefully review those changes and resolve the conflicts.
git merge f4b6e09884bb2ea2f9af1129bd5e1bf8f9ef2ffc
  1. Install ruff.

    pip install ruff==0.1.8
    

  2. Auto-format and commit your code.

    ruff format . && git commit -am "autoformat"
    

  3. Merge the formatted code. This shouldn't have any conflicts.

    git merge 5d5879a4b4f12fec1ebd0d133684190810b6a838 -X ours
    

  4. Merge the develop branch. There might be conflicts at this stage, carefully review those changes and resolve the conflicts.

    git merge develop
    

Optional step:

  1. Configure your git blame to ignore the formatting changes.
    git config blame.ignoreRevsFile .git-blame-ignore-revs