Code styling tool for all of OF #1542

Merged
merged 9 commits into from Nov 14, 2012

Conversation

Projects
None yet
2 participants
Owner

bilderbuchi commented Sep 4, 2012

I made a styling script for all of OF. It automatically formats OF core, files in src folders in official addons and in all examples.
Just run ./styleWholeOF to do this. you can redirect output to a .log file if you want, those are being ignored in gitignore.

I have not yet included the formatting commit itself. It's huge, and it may be better to wait until after 0072, but now everyone can easily do this him/herself to check the changes.

It's not yet totally automated (so no return values etc.), so we can't use it for automated CI checks yet.

@ofTheo @arturoc @kylemcd and whoever is in Maine, I guess this could be useful for you - if you read the already formatted core, the code style can at the same time be assessed and any edge cases identified (so we can tweak it).

Code styling needs uncrustify >= 0.58 (for that one mal-formatted >= in a template+trinary logic statement), but this is already in homebrew and macports afaik, and for ubuntu users the 12.10 package works flawlessly even in 12.04.

Owner

bilderbuchi commented Sep 4, 2012

p.s. If you end up committing the formatted code (in a separate branch), I recommend the following commit message:

Format OF according to the current code style.

These are mostly whitespace changes.
When using git, you can ignore whitespace changes in relevant commands
by using the '-w' option. 
On Github, the same can be accomplished by appending '?w=1' to any URL.
Owner

bilderbuchi commented Nov 14, 2012

So, could somebody review this? I'd like to merge this in as we need to work on this for more OF automation.

Contributor

ofTheo commented Nov 14, 2012

looks good to me!
go for it.

@bilderbuchi bilderbuchi added a commit that referenced this pull request Nov 14, 2012

@bilderbuchi bilderbuchi Merge pull request #1542 from bilderbuchi/code-formatting
Code styling tool for all of OF
c2f6662

@bilderbuchi bilderbuchi merged commit c2f6662 into openframeworks:develop Nov 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment