[Tuxpaint-devel] Tux Paint 'indent'-ified!
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2017-10-15 19:30:10
|
Tux Paint's source code has been in terrible shape, formatting-wise, for many years. Combinations of tabs and spaces, along with various people's styles (or lack thereof) caused things to look fairly terrible and no doubt would scare off any newcomers who might want to contribute to the project. So, I've just run `indent` on basically the whole codebase (some Mac-specific Objective C stuff was untouched, but a few header .h files were). The main source code directories (src/, magic/src/, and macosx/) have an `indent` config file (`.indent.pro`), so it should be simply a matter of running indent SOMEFILE.c after adding or modifying a file, to keep the formatting consistent. Note that, at least the way I _intended_ it to work, is for `.indent.pro` to live in src/, while the other two copies are symbolic links to that file. Seems to have worked, in Git, but YMMV depending on what platform you're checking things out on. (e.g. https://sourceforge.net/p/tuxpaint/tuxpaint/ci/master/tree/macosx/.indent.pro) FYI, the options I preferred were: --blank-lines-after-declarations --blank-lines-after-procedures --break-before-boolean-operator --continue-at-parentheses --declaration-indentation1 --dont-break-function-decl-args --dont-break-procedure-type --line-length120 --no-blank-lines-after-commas --no-space-after-casts --no-space-after-function-call-names --no-space-after-parentheses --no-tabs FWIW, things still seem to run for me. :) Let me know if you have any issues. And of course, be sure to `git pull --all` ASAP, before making any code changes, so that you're also working off the latest, nicely-formatted codebase! Thanks, -- -bill! Sent from my computer |