{"action":"created","comment":{"url":"https://api.github.com/repos/cookpad/styleguide/pulls/comments/59665630","id":59665630,"diff_hunk":"@@ -160,18 +153,48 @@ http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml\n view.backgroundColor = [UIColor whiteColor];\n ```\n \n+* **[MUST]** プロパティの宣言などでカラムの位置は調整しなくてよい\n+  * 修正時の差分を最小にするため\n+\n+```objc\n+// Bad\n+@property (nonatomic)       int       foo;\n+@property (nonatomic, copy) NSString *bar;\n+\n+// Good\n+@property (nonatomic) int foo;\n+@property (nonatomic, copy) NSString *bar;\n+```\n+\n+\n <a id=\"Variables\"></a>\n ## 変数\n \n-- **[MUST]** スコープがもっとも狭くなるように宣言すること。スコープによるバグを防ぐため。C言語古来の関数の先頭にすべての変数を宣言するスタイルは使わない。\n+- **[MUST]** スコープがもっとも狭くなるように宣言すること\n+- **[MUST]** 変数の再利用をしてはいけない\n+  - 同じ型の変数であっても、用途が違う場合は都度用途に適した名前を付けて宣言すること\n+- **[MUST]** 定数としては `extern NSString *const FOO_BAR` またはNS_ENUMを使うこと\n+  - 定数としてマクロを使ってはならない\n+\n+<a id=\"Types\"></a>\n+## 型\n+\n+- **[MUST]** pointerのアスタリスクは型ではなく変数につけること\n+- **[MUST]** 原則として生の `id` 型を使用してはいけない\n+  * CocoaTouchの仕様上必要な場合を除き、明示的に使う必要はないはずである\n+  * プロトコルつきの `id<Protocol>` はこの限りではない\n+- **[MUST]** Xcode 7以上を使っている場合はコレクション型でgenericsを使うこと\n+  * genericsにできない場合は設計が間違っている可能性がある\n+- **[SHOULD]** `nullable` / `nonnull` が使える場所ではなるべく使うこと","path":"objective-c.ja.md","position":242,"original_position":242,"commit_id":"aa37fdfc775b1a3027c5009e8f16e2a014fc8a64","original_commit_id":"aa37fdfc775b1a3027c5009e8f16e2a014fc8a64","user":{"login":"slightair","id":490733,"avatar_url":"https://avatars.githubusercontent.com/u/490733?v=3","gravatar_id":"","url":"https://api.github.com/users/slightair","html_url":"https://github.com/slightair","followers_url":"https://api.github.com/users/slightair/followers","following_url":"https://api.github.com/users/slightair/following{/other_user}","gists_url":"https://api.github.com/users/slightair/gists{/gist_id}","starred_url":"https://api.github.com/users/slightair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slightair/subscriptions","organizations_url":"https://api.github.com/users/slightair/orgs","repos_url":"https://api.github.com/users/slightair/repos","events_url":"https://api.github.com/users/slightair/events{/privacy}","received_events_url":"https://api.github.com/users/slightair/received_events","type":"User","site_admin":false},"body":"> これが MUST じゃない理由が知りたいっす。\r\n> 新たに追加されるコードに対しては MUST で良い気がする。\r\n\r\n基本は使っていく事になると思うけれど、既存のクラスにプロパティを追加するときとかは全部を修正しないとコンパイルエラーになってしまうので SHOULD にとどめるのが現実的かも","created_at":"2016-04-14T05:43:14Z","updated_at":"2016-04-14T05:43:14Z","html_url":"https://github.com/cookpad/styleguide/pull/25#discussion_r59665630","pull_request_url":"https://api.github.com/repos/cookpad/styleguide/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/comments/59665630"},"html":{"href":"https://github.com/cookpad/styleguide/pull/25#discussion_r59665630"},"pull_request":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/cookpad/styleguide/pulls/25","id":37987184,"html_url":"https://github.com/cookpad/styleguide/pull/25","diff_url":"https://github.com/cookpad/styleguide/pull/25.diff","patch_url":"https://github.com/cookpad/styleguide/pull/25.patch","issue_url":"https://api.github.com/repos/cookpad/styleguide/issues/25","number":25,"state":"open","locked":false,"title":"update objective-c styleguide","user":{"login":"gfx","id":101800,"avatar_url":"https://avatars.githubusercontent.com/u/101800?v=3","gravatar_id":"","url":"https://api.github.com/users/gfx","html_url":"https://github.com/gfx","followers_url":"https://api.github.com/users/gfx/followers","following_url":"https://api.github.com/users/gfx/following{/other_user}","gists_url":"https://api.github.com/users/gfx/gists{/gist_id}","starred_url":"https://api.github.com/users/gfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfx/subscriptions","organizations_url":"https://api.github.com/users/gfx/orgs","repos_url":"https://api.github.com/users/gfx/repos","events_url":"https://api.github.com/users/gfx/events{/privacy}","received_events_url":"https://api.github.com/users/gfx/received_events","type":"User","site_admin":false},"body":"Objective-Cのスタイルガイドを見なおしました。関係者各位レビューをお願いします。\r\n\r\nまだ決定版ではないので、これをたたき台にしてブラッシュアップしましょう。\r\n\r\n## 主な変更点\r\n\r\n* ARCなどの自明なものは削除\r\n* SHOULDはほぼすべてMUSTに格上げ\r\n* assign, strongなどの冗長な指定はせず、nonatomicを必ず指定するようにした\r\n* Swift化を見越したnullability, generics, `if (x == nil)` の強制\r\n","created_at":"2015-06-18T09:30:53Z","updated_at":"2016-04-14T05:43:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e10e3f5a1831c7ef7a819fe1e17c821a6b0c08f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cookpad/styleguide/pulls/25/commits","review_comments_url":"https://api.github.com/repos/cookpad/styleguide/pulls/25/comments","review_comment_url":"https://api.github.com/repos/cookpad/styleguide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cookpad/styleguide/issues/25/comments","statuses_url":"https://api.github.com/repos/cookpad/styleguide/statuses/aa37fdfc775b1a3027c5009e8f16e2a014fc8a64","head":{"label":"cookpad:objectivec-style-2015","ref":"objectivec-style-2015","sha":"aa37fdfc775b1a3027c5009e8f16e2a014fc8a64","user":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"repo":{"id":17157951,"name":"styleguide","full_name":"cookpad/styleguide","owner":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cookpad/styleguide","description":"Cookpad's coding style guides","fork":false,"url":"https://api.github.com/repos/cookpad/styleguide","forks_url":"https://api.github.com/repos/cookpad/styleguide/forks","keys_url":"https://api.github.com/repos/cookpad/styleguide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cookpad/styleguide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cookpad/styleguide/teams","hooks_url":"https://api.github.com/repos/cookpad/styleguide/hooks","issue_events_url":"https://api.github.com/repos/cookpad/styleguide/issues/events{/number}","events_url":"https://api.github.com/repos/cookpad/styleguide/events","assignees_url":"https://api.github.com/repos/cookpad/styleguide/assignees{/user}","branches_url":"https://api.github.com/repos/cookpad/styleguide/branches{/branch}","tags_url":"https://api.github.com/repos/cookpad/styleguide/tags","blobs_url":"https://api.github.com/repos/cookpad/styleguide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cookpad/styleguide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cookpad/styleguide/git/refs{/sha}","trees_url":"https://api.github.com/repos/cookpad/styleguide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cookpad/styleguide/statuses/{sha}","languages_url":"https://api.github.com/repos/cookpad/styleguide/languages","stargazers_url":"https://api.github.com/repos/cookpad/styleguide/stargazers","contributors_url":"https://api.github.com/repos/cookpad/styleguide/contributors","subscribers_url":"https://api.github.com/repos/cookpad/styleguide/subscribers","subscription_url":"https://api.github.com/repos/cookpad/styleguide/subscription","commits_url":"https://api.github.com/repos/cookpad/styleguide/commits{/sha}","git_commits_url":"https://api.github.com/repos/cookpad/styleguide/git/commits{/sha}","comments_url":"https://api.github.com/repos/cookpad/styleguide/comments{/number}","issue_comment_url":"https://api.github.com/repos/cookpad/styleguide/issues/comments{/number}","contents_url":"https://api.github.com/repos/cookpad/styleguide/contents/{+path}","compare_url":"https://api.github.com/repos/cookpad/styleguide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cookpad/styleguide/merges","archive_url":"https://api.github.com/repos/cookpad/styleguide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cookpad/styleguide/downloads","issues_url":"https://api.github.com/repos/cookpad/styleguide/issues{/number}","pulls_url":"https://api.github.com/repos/cookpad/styleguide/pulls{/number}","milestones_url":"https://api.github.com/repos/cookpad/styleguide/milestones{/number}","notifications_url":"https://api.github.com/repos/cookpad/styleguide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cookpad/styleguide/labels{/name}","releases_url":"https://api.github.com/repos/cookpad/styleguide/releases{/id}","deployments_url":"https://api.github.com/repos/cookpad/styleguide/deployments","created_at":"2014-02-25T02:01:07Z","updated_at":"2016-04-14T00:33:16Z","pushed_at":"2016-02-10T08:55:41Z","git_url":"git://github.com/cookpad/styleguide.git","ssh_url":"git@github.com:cookpad/styleguide.git","clone_url":"https://github.com/cookpad/styleguide.git","svn_url":"https://github.com/cookpad/styleguide","homepage":"","size":408,"stargazers_count":666,"watchers_count":666,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":5,"forks":74,"open_issues":5,"watchers":666,"default_branch":"master"}},"base":{"label":"cookpad:master","ref":"master","sha":"d99b76dcca139be0b7731f66aa5d4e1c769c3873","user":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"repo":{"id":17157951,"name":"styleguide","full_name":"cookpad/styleguide","owner":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cookpad/styleguide","description":"Cookpad's coding style guides","fork":false,"url":"https://api.github.com/repos/cookpad/styleguide","forks_url":"https://api.github.com/repos/cookpad/styleguide/forks","keys_url":"https://api.github.com/repos/cookpad/styleguide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cookpad/styleguide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cookpad/styleguide/teams","hooks_url":"https://api.github.com/repos/cookpad/styleguide/hooks","issue_events_url":"https://api.github.com/repos/cookpad/styleguide/issues/events{/number}","events_url":"https://api.github.com/repos/cookpad/styleguide/events","assignees_url":"https://api.github.com/repos/cookpad/styleguide/assignees{/user}","branches_url":"https://api.github.com/repos/cookpad/styleguide/branches{/branch}","tags_url":"https://api.github.com/repos/cookpad/styleguide/tags","blobs_url":"https://api.github.com/repos/cookpad/styleguide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cookpad/styleguide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cookpad/styleguide/git/refs{/sha}","trees_url":"https://api.github.com/repos/cookpad/styleguide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cookpad/styleguide/statuses/{sha}","languages_url":"https://api.github.com/repos/cookpad/styleguide/languages","stargazers_url":"https://api.github.com/repos/cookpad/styleguide/stargazers","contributors_url":"https://api.github.com/repos/cookpad/styleguide/contributors","subscribers_url":"https://api.github.com/repos/cookpad/styleguide/subscribers","subscription_url":"https://api.github.com/repos/cookpad/styleguide/subscription","commits_url":"https://api.github.com/repos/cookpad/styleguide/commits{/sha}","git_commits_url":"https://api.github.com/repos/cookpad/styleguide/git/commits{/sha}","comments_url":"https://api.github.com/repos/cookpad/styleguide/comments{/number}","issue_comment_url":"https://api.github.com/repos/cookpad/styleguide/issues/comments{/number}","contents_url":"https://api.github.com/repos/cookpad/styleguide/contents/{+path}","compare_url":"https://api.github.com/repos/cookpad/styleguide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cookpad/styleguide/merges","archive_url":"https://api.github.com/repos/cookpad/styleguide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cookpad/styleguide/downloads","issues_url":"https://api.github.com/repos/cookpad/styleguide/issues{/number}","pulls_url":"https://api.github.com/repos/cookpad/styleguide/pulls{/number}","milestones_url":"https://api.github.com/repos/cookpad/styleguide/milestones{/number}","notifications_url":"https://api.github.com/repos/cookpad/styleguide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cookpad/styleguide/labels{/name}","releases_url":"https://api.github.com/repos/cookpad/styleguide/releases{/id}","deployments_url":"https://api.github.com/repos/cookpad/styleguide/deployments","created_at":"2014-02-25T02:01:07Z","updated_at":"2016-04-14T00:33:16Z","pushed_at":"2016-02-10T08:55:41Z","git_url":"git://github.com/cookpad/styleguide.git","ssh_url":"git@github.com:cookpad/styleguide.git","clone_url":"https://github.com/cookpad/styleguide.git","svn_url":"https://github.com/cookpad/styleguide","homepage":"","size":408,"stargazers_count":666,"watchers_count":666,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":5,"forks":74,"open_issues":5,"watchers":666,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/25"},"html":{"href":"https://github.com/cookpad/styleguide/pull/25"},"issue":{"href":"https://api.github.com/repos/cookpad/styleguide/issues/25"},"comments":{"href":"https://api.github.com/repos/cookpad/styleguide/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cookpad/styleguide/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/cookpad/styleguide/statuses/aa37fdfc775b1a3027c5009e8f16e2a014fc8a64"}}}}