indragiek / INAppStoreWindow

NSWindow subclass with a highly customizable title bar and traffic lights
BSD 2-Clause "Simplified" License
1.06k stars 162 forks source link

Fix all the style inconsistencies #164

Closed indragiek closed 10 years ago

indragiek commented 10 years ago

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.

jakepetroules commented 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
indragiek commented 10 years ago

@jakepetroules That only handles whitespace, unfortunately. clang-format can fix much more than that.

jakepetroules commented 10 years ago

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. :(

indragiek commented 10 years ago

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.

jakepetroules commented 10 years ago

Yes, clang-format would be ideal but it's quite heavyweight and you can't expect most people to have it installed.

jakepetroules commented 10 years ago

Regarding the above... Xcode plugin manager "Alcatraz" + clang-format plugin works pretty nicely.

indragiek commented 10 years ago

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.

jakepetroules commented 10 years ago

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

indragiek commented 10 years ago

Fair enough. #178