Topic: Tabs or Spaces
stonerl Topic Opener |
Posted at: 2018-08-19, 21:44
Looking through the files I noticed that the lua files use 3 spaces for indentation, while the c++ part uses a 3 spaced tab. But some files use a mix of tabs and spaces; launch_mpg.cc for example. The Contribute Site references the Google Style Code, but there it says no tabs only 2 spaces... Top Quote |
GunChleoc |
Posted at: 2018-08-20, 09:52
SirVer and I didn't really agree on this - I prefer tabs, he prefers spaces. SO, there was never any consensus. Lua should definitely use spaces now, because we have a script for fixing the indentation that depends on it. I'm surprised that clang-format doesn't unify matters for C++ though - we run it on every merge to trunk. Busy indexing nil values Top Quote |
stonerl Topic Opener |
Posted at: 2019-05-09, 15:15
Could we agree on tabs for all c++ and spaces for lua files? Lua files are all spaced, while c++ files are predominantly tabbed and especially hard to work with since some of them have spaces and tabs mixed all over the place. Top Quote |
hessenfarmer |
Posted at: 2019-05-09, 16:11
I recently saw that spaces in C++ were often used if codelines had to be continued in the next line due to longer than our max line length. I sometimes had the impression that these were formatted this way by a script but I don't know for sure. Top Quote |
GunChleoc |
Posted at: 2019-05-10, 08:37
Bunnybot uses clang-format when merging to master, and also runs a script that SirVer wrote to fix the indentation in Lua. clang-format is set to use tabs, Lua is formatted with spaces. So, this is already being done as you suggest. clang-format is controlled by a I'm against doing a whole-sale reformatting right now, because we have a lot of branches open. Busy indexing nil values Top Quote |