Reformatting the source

From Unvanquished
Jump to: navigation, search

The Daemon and Unvanquished repositories suffer from differing code style conventions and fractally varying choice of indentation (spaces vs. tabs). The inconsistency is a constant source of friction for developers. I (slipher) propose that we may reformat the source code (in one big commit) if we have all of the following:

  1. Whitespace-ignoring replacements for 'git diff' and 'git blame'
  2. A configuration file for some cross-platform formatting tool which produces satisfying results
  3. Instructions on how to install the formatting tool
  4. A script to rewrite a chain of commits using the formatting tool (for use with unmerged branches)

Solutions

  1. freem suggests a method for configuring git blame to ignore a particular commit:

  2. WIP: https://github.com/Unvanquished/Unvanquished/pull/2622
  3.  ?
  4.  ?

Areas requiring special attention

Some people have noted difficulties with autoformatters and lambda functions. cg_api.cpp is one file with a lot of lambdas.

We should consider if we want to preserve formatting of tables such as fields (for map entities) in sg_spawn.cpp.