kodecocodes / objective-c-style-guide

A style guide that outlines the coding conventions for Kodeco
http://www.raywenderlich.com/62570/objective-c-style-guide
3.1k stars 628 forks source link

Can we lint to enforce some of this style guide? #36

Closed ColinEberhardt closed 10 years ago

ColinEberhardt commented 10 years ago

I just finished writing a tutorial when I noticed right near the end an issue with the starter project. Most annoying!

I am just thinking out loud here, I wonder how much of this style guide you can enforce using static analysis tools. I haven't tried any Objective-C linting tools yet, has anyone tried OCLint or similar?

By skimming through our rules, I think it should be possible to enforce around 70% using a linking tool. And if such a tool doesn't exist - it's time to build one!

ColinEberhardt commented 10 years ago

Hmm .. looks like OCLint operates on the abstract syntax tree so will not catch formatting issues.

gregheo commented 10 years ago

There was some talk about a set of uncrustify settings to enforce some of these things. I think we can get a good number of these guidelines automated!

http://uncrustify.sourceforge.net/ http://uncrustify.sourceforge.net/default.cfg

rwenderlich commented 10 years ago

Any volunteers? :]

gregheo commented 10 years ago

I'll volunteer to start it off with some of the basics. After that, pull requests will be very welcome!

rwenderlich commented 10 years ago

w00t, you rule Greg! Thanks so much that will be a lifesaver for editing (and authors too!) :]

gregheo commented 10 years ago

Finally, a pull request. And since it's coming from me, a test too!