playgroundbooks / playgroundbook

Tool for Swift Playground books
https://ashfurrow.com/blog/swift-playground-books/
MIT License
259 stars 17 forks source link

Add Rubocop to project #8

Closed rhysforyou closed 8 years ago

rhysforyou commented 8 years ago

This PR aims to clean up the existing codebase and address #7 by adding Rubocop to the project. I've also gone ahead and had Rubocop go through and automatically fix style violations where it can, but a few still remain that I'd like to address before merging this PR.

rhysforyou commented 8 years ago

Also would it be worth setting up something like Danger to report style violations in PRs?

rhysforyou commented 8 years ago

The remaining issues here broadly fall into two key categories:

The latter is something we can fix pretty easily, but in the case of the former I think we need to make a decision. Do we care about line length when people are typically using editors with soft-wrapping support? Do we want to hard wrap those lines or disable the rule.

ashfurrow commented 8 years ago

Thanks so much! I don't particularly care about line length, in other project's I've set the max length to 120 and that gets most of them. I think we can probably disable it. Let me know what I can do to help!

rhysforyou commented 8 years ago

I've disabled the line length cop and made a first pass at some class documentation, which resolves all the remaining rubocop warnings. This documentation might need some more polish and I'm happy to accept feedback on that, and additionally it might be wise to integrate this with something like Danger to improve the visibility of these warnings. But for now I'm happy with where this at and dropping the [WIP] label from this PR.

ashfurrow commented 8 years ago

This is fantastic, thank you!