Affects Version/s: None
Fix Version/s: None
We have a number of different formats in use across our various languages. I would like to come up with one format for each language and a set of tools that can implement/enforce that format.
In general, we seek three goals:
- Where possible, we create a formatting file for existing code bases that creates the least amount of formatting changes.
- If changes are necessary, it is because we wish to make those code bases similar to other existing code bases.
- When choosing tooling, we prefer configuring built-in tooling (i.e. adding a formatting file to Eclipse) vs using an external third-party formatter. This is to reduce the amount of effort needed for contributors to adhere to this format.
Some cross-language tenets we adhere to:
- Indentation: Tabs, with spaces for alignment. Most of our existing code uses tabs.
- Opening curly brace: New line, except for blocks and flow control and lambdas
- Closing curly brace: New line
- Max line length: Prefer 120, but might keep at 200 for existing code bases to reduce formatting
- Tab Width: 4