{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-no-kai/official/issues/244","repository_url":"https://api.github.com/repos/ruby-no-kai/official","labels_url":"https://api.github.com/repos/ruby-no-kai/official/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/ruby-no-kai/official/issues/244/comments","events_url":"https://api.github.com/repos/ruby-no-kai/official/issues/244/events","html_url":"https://github.com/ruby-no-kai/official/issues/244","id":180888657,"number":244,"title":"基本的なコーディング規約をまとめたい","user":{"login":"takahashim","id":10401,"avatar_url":"https://avatars.githubusercontent.com/u/10401?v=3","gravatar_id":"","url":"https://api.github.com/users/takahashim","html_url":"https://github.com/takahashim","followers_url":"https://api.github.com/users/takahashim/followers","following_url":"https://api.github.com/users/takahashim/following{/other_user}","gists_url":"https://api.github.com/users/takahashim/gists{/gist_id}","starred_url":"https://api.github.com/users/takahashim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahashim/subscriptions","organizations_url":"https://api.github.com/users/takahashim/orgs","repos_url":"https://api.github.com/users/takahashim/repos","events_url":"https://api.github.com/users/takahashim/events{/privacy}","received_events_url":"https://api.github.com/users/takahashim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-04T13:10:31Z","updated_at":"2016-10-04T16:06:15Z","closed_at":null,"body":"Rubyのプロジェクトを始めるにあたりRubyのコーディング規約を調べたけれど良くわからない（信頼性高そうなところとしてRubyアソシエーションのサイトを見たら「Rubyの正式なコーディング規約はありません。」( http://www.ruby.or.jp/ja/tech/development/ruby/050_coding_rule.html )と書いてあり、参考の規約がいくつか載っているけれどもどれを選べばいいのかも良くわからない）ので困った、という話を聞きました。\r\n\r\nどれか一つに決めようとすると戦争になりそうですが、そうは言ってもそこそこ汎用的な指針があった方がよさそうです。\r\n複数の規約をベースにして最大公約数的なものを用意したりするのはどうでしょうか…？\r\n\r\n## 書かないこと\r\n\r\n* 1行の文字数の上限\r\n* メソッドのカッコの省略可否\r\n* 文字列リテラルの`\"`と`'`の使い分け\r\n* `%`記法の区切り文字\r\n\r\n## 書きたいこと\r\n\r\n* クラス名はCamelCaseにする\r\n* メソッド名はsnake_caseにする\r\n* ifのあとのthenは省略する\r\n* 1クラスは原則1ファイルに書く（例外あり）\r\n* ファイル名はクラス名を小文字にしたものにする。ただし大文字と小文字の境界に「_」を挟む（挟まない場合もある）\r\n\r\n## 迷うもの\r\n\r\n* ブロックの`do`〜`end`と`{`〜`}`の使い分け\r\n* インデントのスペース(と文字数)/タブ\r\n"},"comment":{"url":"https://api.github.com/repos/ruby-no-kai/official/issues/comments/251433860","html_url":"https://github.com/ruby-no-kai/official/issues/244#issuecomment-251433860","issue_url":"https://api.github.com/repos/ruby-no-kai/official/issues/244","id":251433860,"user":{"login":"takahashim","id":10401,"avatar_url":"https://avatars.githubusercontent.com/u/10401?v=3","gravatar_id":"","url":"https://api.github.com/users/takahashim","html_url":"https://github.com/takahashim","followers_url":"https://api.github.com/users/takahashim/followers","following_url":"https://api.github.com/users/takahashim/following{/other_user}","gists_url":"https://api.github.com/users/takahashim/gists{/gist_id}","starred_url":"https://api.github.com/users/takahashim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takahashim/subscriptions","organizations_url":"https://api.github.com/users/takahashim/orgs","repos_url":"https://api.github.com/users/takahashim/repos","events_url":"https://api.github.com/users/takahashim/events{/privacy}","received_events_url":"https://api.github.com/users/takahashim/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T16:06:15Z","updated_at":"2016-10-04T16:06:15Z","body":"bbatsovのは選択式 https://github.com/bbatsov/ruby-style-guide#strings ,クックパッドは規定はないけど空文字列は「`''`」決め打ち https://github.com/cookpad/styleguide/blob/master/ruby.ja.md#strings 、airbnbは規定はないけど両方を併用、…という感じなので、現時点で「`\"`〜`\"`」が一般的とは言い切れないようです。とはいえ、もう少し時間が立つと変わってくるのかも。"}}
{"actor":{"display_login":"takahashim"}}