Open graingert opened 5 years ago
Does anyone have any advice for projects that are rolling this out, specifically to make it easy for existing PRs to merge? We're planning on rolling this out in xarray and looking to ease the transition.
Off the top of my head I'm thinking we can ask existing PRs to:
black
commit (any conflicts are real conflicts and require resolving)black .
to this branchblack
commit, resolving in favor of our changes: git merge [black-commit] -X ours
I generally recommend the second approach (apply black to the PR before merging), it works well
I had meant those as a list of steps, rather than options. My experience is that only running black on a feature branch creates a bunch of conflicts on merging in a master with black previously applied. I just attempted on a test feature branch, and it did create conflicts. I think that makes sense - both parents have changes over the lines of the feature branch (assuming the feature branch has edits to existing lines).
Am I missing something?
Provide a merge driver tool similar to clang_format_merge_driver to allow easier merge conflict resolution when merging non-blackened branches into a blackened branch
https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/master/clang_format_merge_driver.py