We have an existing code base in Python which doesn't yet use any code formatting tool. Now we have settled on YAPF as a tool and also created its configuration file. To me it is not clear how to reformat the code base without causing havoc in further rebases.
At the moment we rebase everything onto master
such that it is a linear history. Some feature branches will need to rebase. This means that all commits in the branch will have to be rebased onto a new master
with different formatting. This will likely lead to a lot of merge conflicts in the application of the individual patches.
Git rebase has the option --ignore-whitespace
which will likely get us pretty far. But there still may be some issues left over. We will of course try to have the least number of non-master
commits around.
Is there some established way to introduce a formatting tool into an existing codebase like this?