{"action":"created","issue":{"url":"https://api.github.com/repos/v0dro/daru/issues/119","repository_url":"https://api.github.com/repos/v0dro/daru","labels_url":"https://api.github.com/repos/v0dro/daru/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/v0dro/daru/issues/119/comments","events_url":"https://api.github.com/repos/v0dro/daru/issues/119/events","html_url":"https://github.com/v0dro/daru/pull/119","id":153475907,"number":119,"title":"[WIP] Applying Rubocop + code cleanup","user":{"login":"zverok","id":129656,"avatar_url":"https://avatars.githubusercontent.com/u/129656?v=3","gravatar_id":"","url":"https://api.github.com/users/zverok","html_url":"https://github.com/zverok","followers_url":"https://api.github.com/users/zverok/followers","following_url":"https://api.github.com/users/zverok/following{/other_user}","gists_url":"https://api.github.com/users/zverok/gists{/gist_id}","starred_url":"https://api.github.com/users/zverok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zverok/subscriptions","organizations_url":"https://api.github.com/users/zverok/orgs","repos_url":"https://api.github.com/users/zverok/repos","events_url":"https://api.github.com/users/zverok/events{/privacy}","received_events_url":"https://api.github.com/users/zverok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-05-06T15:25:54Z","updated_at":"2016-05-09T07:29:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/v0dro/daru/pulls/119","html_url":"https://github.com/v0dro/daru/pull/119","diff_url":"https://github.com/v0dro/daru/pull/119.diff","patch_url":"https://github.com/v0dro/daru/pull/119.patch"},"body":"Hey.\r\n\r\nHere's some work-in-progress I'd like to propose and discuss.\r\n\r\n**The idea**\r\n\r\nI am adding Rubocop to daru, and want to change code so that RuboCop will be happy with it. Some things, like personal code styles of maintainers, or other project guidelines, can be outlined in .rubocop.yml\r\n\r\n**Reasons**\r\n\r\n1. As daru becames mature project, and gets more and more contributors, it becames valuable to maintain common code style/standarts, and Rubocop allows to enforce them;\r\n2. Many of Rubocop's suggestions are not only about style, but also about quality (too complex or unmaintainable code), and my experience says it is always good to at least try to follow all the suggestions.\r\n\r\n**Plan**\r\n\r\nCurrently, I've added the Rubocop, and generated \"todo\" config from code base: https://github.com/zverok/daru/blob/rubocop/.rubocop_todo.yml\r\n\r\nAlso, I've already fixed one cop (pretty huge, it says \"don't use reduce when you can use each_with_object\", but while fixing it, I've also simplified several things where possible).\r\n\r\nThen, I'm planning to go through that TODO cop-by-cop, and either fix them, or, if necessary, move to main `.rubocop.yml` as a daru accepted style. While doing so, I'll not change any external APIs, or even rewrite large portions of code (like renaming instance variables and so on), just cleanup and necessary small refactorings.\r\n\r\nThen, I think Rubocop check should be added to Travis for CI checking on new pull requests.\r\n\r\nSo, my questions for @v0dro and other maintainers:\r\n* should I proceed (or maybe it is not a best time to do this work?.. or it is generally considered not welcome?)\r\n* whether there are some already known style preferences (like map over collect, spaces inside/around blocks, parens on method definitions) I can set up right now?\r\n* whether it will be more wise to do One Huge pull request when I'm done (of course, with proper rebasing from what would be master state to that time) or ton of smaller ones from time to time?"},"comment":{"url":"https://api.github.com/repos/v0dro/daru/issues/comments/217794233","html_url":"https://github.com/v0dro/daru/pull/119#issuecomment-217794233","issue_url":"https://api.github.com/repos/v0dro/daru/issues/119","id":217794233,"user":{"login":"zverok","id":129656,"avatar_url":"https://avatars.githubusercontent.com/u/129656?v=3","gravatar_id":"","url":"https://api.github.com/users/zverok","html_url":"https://github.com/zverok","followers_url":"https://api.github.com/users/zverok/followers","following_url":"https://api.github.com/users/zverok/following{/other_user}","gists_url":"https://api.github.com/users/zverok/gists{/gist_id}","starred_url":"https://api.github.com/users/zverok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zverok/subscriptions","organizations_url":"https://api.github.com/users/zverok/orgs","repos_url":"https://api.github.com/users/zverok/repos","events_url":"https://api.github.com/users/zverok/events{/privacy}","received_events_url":"https://api.github.com/users/zverok/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T07:29:30Z","updated_at":"2016-05-09T07:29:30Z","body":"> If you're sure this ready for merge, I'll do that. Also, is it possible to remove the TODO files from the repo?\r\n\r\nCurrently, `.rubocop_todo.yml` plays two roles:\r\n1. marks what should be fixed\r\n2. makes those checks disabled (`.rubocop_todo.yml` is included in `.rubocop.yml` [here](https://github.com/v0dro/daru/pull/119/files#diff-11a0d7906801d9dea0eccb85667ad811R1))\r\n\r\nIf we'll just remove this file, corresponding checks would be red.\r\n\r\nIn fact, having `.rubocop_todo.yml` in repo is acceptable practice (even Rubocop itself have it), but I can move all checks from there into `# TODO` section in main `.rubocop.yml` if you think it would be cleaner."}}