Source-control friendly formatting

The formatting of JUCE is (a style
                           which indents
                           some stuff to (align
                                          with other stuff
                                          from previous lines));

The implications of this formatting style is that some word changes become multi-line changes and require extra work when handling merge-conflicts.

This extra work falls on anyone maintaining a JUCE fork but also I’m sure on the JUCE devs themselves whenever they want to git stash/revert/cherry-pick or rebase feature branches.


For an example of this see soundradix/JUCE@f2ace272e, a merge commit in our celemerge branch which is a merge of Celemony’s fork and the JUCE develop branch (without extra SR fork changes). This merge had two spurious merge conflicts because of this styling.

For example:

The two changes:

  • Celemony’s fork added a line with Projucer ARA settings, at the previous indentation level
  • JUCE team changed the type of the properties to ValueTreePropertyWithDefault, and the change of the type mandated changing the alignment of the subsequent lines according to the style.

Suggested style

Whenever splitting an expression to several lines (
    make the resumption be indented
    by only a single indentation level);

This btw is also the common formatting used in modern languages like Rust.