[Solved] Introducing a code formatter to an existing code base with running branches

Martin Ueding Asks: Introducing a code formatter to an existing code base with running branches
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?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.