ScottishCovidResponse / SCRCIssueTracking

Central issue tracking repository for all repos in the consortium
6 stars 0 forks source link

Automatic code formatting causes merge conflicts on master branch #744

Closed peter-t-fox closed 3 years ago

peter-t-fox commented 3 years ago

The CI is configured to automatically run a code-formatting tool clang-format whenever a merge occurs to the master branch.

The format specifies an IndentWidth of 2 spaces, which means that almost all of the code gets updated away from its standard indentation of 4 spaces when the merge from dev to `master occurs.

Since no merge back from master to dev occurs with the automatics changes, subsequent attempts to merge to master will fail because of merge conflicts (triggered by any subsequent changes made on dev). This renders the master branch effectively unusable for doing releases.

github-actions[bot] commented 3 years ago

Heads up @thibaud-porphyre @peter-t-fox - the "Covid19_EERAModel" label was applied to this issue.

kzscisoft commented 3 years ago

This might be of use later https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configuring-style-with-clang-format

rwj11 commented 3 years ago

It may also be worth investigating e.g. git merge -Xignore-space-change

peter-t-fox commented 3 years ago

Thanks to every one for the feedback. For the moment, my fix will be:

Then we should be able to merge from dev as normal, since the changes that triggered the conflicts will have been reverted.