Closed indragiek closed 10 years ago
Actually, this built-in tool might work... https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/fmt.1.html
fmt -l 4 infile > outfile
@jakepetroules That only handles whitespace, unfortunately. clang-format
can fix much more than that.
Too bad GitHub doesn't have any sort of tools to run post commit scripts on the server side... I miss Gerrit whenever working on GitHub. :(
I can add a pre-commit hook in the git repo itself to normalize everything before the commit is created. Should work just as well.
Yes, clang-format would be ideal but it's quite heavyweight and you can't expect most people to have it installed.
Regarding the above... Xcode plugin manager "Alcatraz" + clang-format plugin works pretty nicely.
Yeah, it's not a bad solution. In hindsight, its a problem that probably shouldn't be solved at the project/repository level so I'm going to close this.
Well, I think placing a .clang-format at the root of the repository would be a good idea. Here's an example that's probably close to what you'd want: https://github.com/sparkle-project/Sparkle/blob/master/.clang-format
Fair enough. #178
There has been quite a few contributions to this project over the last 4 years (which I'm extremely grateful for) but that also means that there are a lot of style inconsistencies in the codebase (whitespace, braces,, etc.) that I missed during code review. I'm writing some config files for
clang-format
for use with all my projects to normalize this stuff.