The topic of making whitespace consistent in the SL viewer codebase was brought up during the last TPVD meeting on 10/28. Unlike previous attempts/discussions about linting and style changes this is only being broached in light of a simple and automated way to merge these changes into forks.
There are two main benefits to making spacing consistent:
1.
Reduction of merge conflicts - many forks have whitespace
that varies from upstream. This causes unnecessary
conflicts when rebasing features.
2. Improved developer experience - Developers will not have to deal with mixed-whitespace files
Both of these points are important, and the impetus is, in part, seeing all the extra noise inconsistent whitespace adds to rebasing features like puppetry onto TPVs. Having such a basic thing be so inconsistent is also, frankly, a bit embarrassing.
To demonstrate adopting these changes is not actually that hard, or world-ending, the whitespace changes have been incorporated into Firestorm and Kokua's codebase in the following repositories:
Adopting these changes took ~30 seconds on WSL after becoming familiar with the merge process, and required that the codebase be up to date with LL's master as of 11/01.
How does the merge work? Draft instructions are here:
https://wiki.secondlife.com/wiki/2022_Consistent_Whitespace but, essentially, they rely on git's ignore-all-space merge strategy that ignores whitespace changes, and a simple whitespace fixing script that TPVs can use to ensure their own files are updated.
The current DRTVWR branch adopts spaces over tabs. This is done because the industry has largely resolved this debate: Microsoft, Google, GNU, and LLVM style guides all use spaces. The vast majority of open source C++ code written (
[1],
[2].) It would be pretty odd for us to go with tabs, even if the viewer started out that way as the process of adopting one or the other is the same.
This is still a proposal, but were we to move forward the adoption would look like this:
1. (Done) A DRTVWR is made containing only whitespace changes
2. (Done) Merge instructions written and shared
3. (WIP) Soak time for folks to test out merges
4. (WIP) DRTVWR is QA'd by LL
5. An official date for DRTVWR merge is shared to TPVDs and opensource-dev mailing list
5. DRTVWR merged into master
6. LL updates C++ style guide
6. TPVs merge LL master changes by following aforementioned instructions
We, collectively, should be able to handle changes like this to improve the quality of life for everyone. In addition to streamlining the CLA, moving to GitHub, increasing PR turnaround time, and entertaining the notion of bringing the linux viewer back: it's going to become a lot easier to contribute features to SL in a modern manner.
Let me or Vir know if there is any feedback. I am, personally, rather interested in seeing this through so please reach out if you/your team wants help, be it questions, or even help incorporating these changes into your codebase if this moves forward.
Second Life: Signal Linden
Discord: Signal Linden#9329