{"action":"created","comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments/41988043","id":41988043,"diff_hunk":"@@ -0,0 +1,92 @@\n+# encoding: utf-8\n+\n+require 'spec_helper'\n+\n+describe RuboCop::Cop::Rails::PluralizationGrammar do\n+  subject(:cop) { described_class.new }\n+  before(:each) do\n+    inspect_source(cop, source)\n+  end\n+\n+  shared_examples 'enforces pluralization grammar' do |method_name|\n+    context \"When #{method_name} is called on an unknown variable\" do\n+      context \"when using the plural form ##{method_name}s\" do\n+        let(:source) { \"some_variable.#{method_name}s\" }\n+        it 'does not register an offense' do\n+          expect(cop.offenses).to be_empty\n+        end\n+      end\n+\n+      context \"when using the singular form ##{method_name}\" do\n+        let(:source) { \"some_method.#{method_name}\" }\n+\n+        it 'registers an offense' do\n+          expect(cop.offenses).to be_empty","path":"spec/rubocop/cop/rails/pluralization_grammar_spec.rb","position":null,"original_position":24,"commit_id":"a979e58c9dd614e6601d2688606e660dcbd144d5","original_commit_id":"5b3fa3efcce5d396cd59280e451965a2d4f585fd","user":{"login":"jonas054","id":336720,"avatar_url":"https://avatars.githubusercontent.com/u/336720?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"body":"That's a pretty weird special case. Who would create a variable or method called `one`? If you really want to handle it, make a special case in the code for receivers called `one`.","created_at":"2015-10-14T12:44:56Z","updated_at":"2015-10-14T12:44:56Z","html_url":"https://github.com/bbatsov/rubocop/pull/2316#discussion_r41988043","pull_request_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316","_links":{"self":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments/41988043"},"html":{"href":"https://github.com/bbatsov/rubocop/pull/2316#discussion_r41988043"},"pull_request":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316"}}},"pull_request":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316","id":47489651,"html_url":"https://github.com/bbatsov/rubocop/pull/2316","diff_url":"https://github.com/bbatsov/rubocop/pull/2316.diff","patch_url":"https://github.com/bbatsov/rubocop/pull/2316.patch","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2316","number":2316,"state":"open","locked":false,"title":"Add Rails/PluralizationGrammar cop","user":{"login":"maxjacobson","id":1421211,"avatar_url":"https://avatars.githubusercontent.com/u/1421211?v=3","gravatar_id":"","url":"https://api.github.com/users/maxjacobson","html_url":"https://github.com/maxjacobson","followers_url":"https://api.github.com/users/maxjacobson/followers","following_url":"https://api.github.com/users/maxjacobson/following{/other_user}","gists_url":"https://api.github.com/users/maxjacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/maxjacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxjacobson/subscriptions","organizations_url":"https://api.github.com/users/maxjacobson/orgs","repos_url":"https://api.github.com/users/maxjacobson/repos","events_url":"https://api.github.com/users/maxjacobson/events{/privacy}","received_events_url":"https://api.github.com/users/maxjacobson/received_events","type":"User","site_admin":false},"body":"This is just a pet peeve of mine. Not sure if it's worth including or not, but maybe? :smile: ","created_at":"2015-10-13T04:18:17Z","updated_at":"2015-10-14T12:44:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc997489afeadec946082e90af4f05b2ffb2046b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316/commits","review_comments_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316/comments","review_comment_url":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2316/comments","statuses_url":"https://api.github.com/repos/bbatsov/rubocop/statuses/a979e58c9dd614e6601d2688606e660dcbd144d5","head":{"label":"maxjacobson:add-grammar-pluralization-cop","ref":"add-grammar-pluralization-cop","sha":"a979e58c9dd614e6601d2688606e660dcbd144d5","user":{"login":"maxjacobson","id":1421211,"avatar_url":"https://avatars.githubusercontent.com/u/1421211?v=3","gravatar_id":"","url":"https://api.github.com/users/maxjacobson","html_url":"https://github.com/maxjacobson","followers_url":"https://api.github.com/users/maxjacobson/followers","following_url":"https://api.github.com/users/maxjacobson/following{/other_user}","gists_url":"https://api.github.com/users/maxjacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/maxjacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxjacobson/subscriptions","organizations_url":"https://api.github.com/users/maxjacobson/orgs","repos_url":"https://api.github.com/users/maxjacobson/repos","events_url":"https://api.github.com/users/maxjacobson/events{/privacy}","received_events_url":"https://api.github.com/users/maxjacobson/received_events","type":"User","site_admin":false},"repo":{"id":38219002,"name":"rubocop","full_name":"maxjacobson/rubocop","owner":{"login":"maxjacobson","id":1421211,"avatar_url":"https://avatars.githubusercontent.com/u/1421211?v=3","gravatar_id":"","url":"https://api.github.com/users/maxjacobson","html_url":"https://github.com/maxjacobson","followers_url":"https://api.github.com/users/maxjacobson/followers","following_url":"https://api.github.com/users/maxjacobson/following{/other_user}","gists_url":"https://api.github.com/users/maxjacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/maxjacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxjacobson/subscriptions","organizations_url":"https://api.github.com/users/maxjacobson/orgs","repos_url":"https://api.github.com/users/maxjacobson/repos","events_url":"https://api.github.com/users/maxjacobson/events{/privacy}","received_events_url":"https://api.github.com/users/maxjacobson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxjacobson/rubocop","description":"A Ruby static code analyzer, based on the community Ruby style guide.","fork":true,"url":"https://api.github.com/repos/maxjacobson/rubocop","forks_url":"https://api.github.com/repos/maxjacobson/rubocop/forks","keys_url":"https://api.github.com/repos/maxjacobson/rubocop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxjacobson/rubocop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxjacobson/rubocop/teams","hooks_url":"https://api.github.com/repos/maxjacobson/rubocop/hooks","issue_events_url":"https://api.github.com/repos/maxjacobson/rubocop/issues/events{/number}","events_url":"https://api.github.com/repos/maxjacobson/rubocop/events","assignees_url":"https://api.github.com/repos/maxjacobson/rubocop/assignees{/user}","branches_url":"https://api.github.com/repos/maxjacobson/rubocop/branches{/branch}","tags_url":"https://api.github.com/repos/maxjacobson/rubocop/tags","blobs_url":"https://api.github.com/repos/maxjacobson/rubocop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxjacobson/rubocop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxjacobson/rubocop/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxjacobson/rubocop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxjacobson/rubocop/statuses/{sha}","languages_url":"https://api.github.com/repos/maxjacobson/rubocop/languages","stargazers_url":"https://api.github.com/repos/maxjacobson/rubocop/stargazers","contributors_url":"https://api.github.com/repos/maxjacobson/rubocop/contributors","subscribers_url":"https://api.github.com/repos/maxjacobson/rubocop/subscribers","subscription_url":"https://api.github.com/repos/maxjacobson/rubocop/subscription","commits_url":"https://api.github.com/repos/maxjacobson/rubocop/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxjacobson/rubocop/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxjacobson/rubocop/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxjacobson/rubocop/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxjacobson/rubocop/contents/{+path}","compare_url":"https://api.github.com/repos/maxjacobson/rubocop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxjacobson/rubocop/merges","archive_url":"https://api.github.com/repos/maxjacobson/rubocop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxjacobson/rubocop/downloads","issues_url":"https://api.github.com/repos/maxjacobson/rubocop/issues{/number}","pulls_url":"https://api.github.com/repos/maxjacobson/rubocop/pulls{/number}","milestones_url":"https://api.github.com/repos/maxjacobson/rubocop/milestones{/number}","notifications_url":"https://api.github.com/repos/maxjacobson/rubocop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxjacobson/rubocop/labels{/name}","releases_url":"https://api.github.com/repos/maxjacobson/rubocop/releases{/id}","created_at":"2015-06-29T00:03:19Z","updated_at":"2015-06-29T00:03:21Z","pushed_at":"2015-10-14T00:44:24Z","git_url":"git://github.com/maxjacobson/rubocop.git","ssh_url":"git@github.com:maxjacobson/rubocop.git","clone_url":"https://github.com/maxjacobson/rubocop.git","svn_url":"https://github.com/maxjacobson/rubocop","homepage":"","size":10008,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbatsov:master","ref":"master","sha":"aa7d73992fcd1abbf3b57e56e6d9888a8e45d682","user":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"repo":{"id":4095287,"name":"rubocop","full_name":"bbatsov/rubocop","owner":{"login":"bbatsov","id":103882,"avatar_url":"https://avatars.githubusercontent.com/u/103882?v=3","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbatsov/rubocop","description":"A Ruby static code analyzer, based on the community Ruby style guide.","fork":false,"url":"https://api.github.com/repos/bbatsov/rubocop","forks_url":"https://api.github.com/repos/bbatsov/rubocop/forks","keys_url":"https://api.github.com/repos/bbatsov/rubocop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbatsov/rubocop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbatsov/rubocop/teams","hooks_url":"https://api.github.com/repos/bbatsov/rubocop/hooks","issue_events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/events{/number}","events_url":"https://api.github.com/repos/bbatsov/rubocop/events","assignees_url":"https://api.github.com/repos/bbatsov/rubocop/assignees{/user}","branches_url":"https://api.github.com/repos/bbatsov/rubocop/branches{/branch}","tags_url":"https://api.github.com/repos/bbatsov/rubocop/tags","blobs_url":"https://api.github.com/repos/bbatsov/rubocop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbatsov/rubocop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbatsov/rubocop/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbatsov/rubocop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbatsov/rubocop/statuses/{sha}","languages_url":"https://api.github.com/repos/bbatsov/rubocop/languages","stargazers_url":"https://api.github.com/repos/bbatsov/rubocop/stargazers","contributors_url":"https://api.github.com/repos/bbatsov/rubocop/contributors","subscribers_url":"https://api.github.com/repos/bbatsov/rubocop/subscribers","subscription_url":"https://api.github.com/repos/bbatsov/rubocop/subscription","commits_url":"https://api.github.com/repos/bbatsov/rubocop/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbatsov/rubocop/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbatsov/rubocop/contents/{+path}","compare_url":"https://api.github.com/repos/bbatsov/rubocop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbatsov/rubocop/merges","archive_url":"https://api.github.com/repos/bbatsov/rubocop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbatsov/rubocop/downloads","issues_url":"https://api.github.com/repos/bbatsov/rubocop/issues{/number}","pulls_url":"https://api.github.com/repos/bbatsov/rubocop/pulls{/number}","milestones_url":"https://api.github.com/repos/bbatsov/rubocop/milestones{/number}","notifications_url":"https://api.github.com/repos/bbatsov/rubocop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbatsov/rubocop/labels{/name}","releases_url":"https://api.github.com/repos/bbatsov/rubocop/releases{/id}","created_at":"2012-04-21T10:09:58Z","updated_at":"2015-10-14T12:41:00Z","pushed_at":"2015-10-14T00:44:25Z","git_url":"git://github.com/bbatsov/rubocop.git","ssh_url":"git@github.com:bbatsov/rubocop.git","clone_url":"https://github.com/bbatsov/rubocop.git","svn_url":"https://github.com/bbatsov/rubocop","homepage":"","size":21384,"stargazers_count":5253,"watchers_count":5253,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":630,"mirror_url":null,"open_issues_count":107,"forks":630,"open_issues":107,"watchers":5253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316"},"html":{"href":"https://github.com/bbatsov/rubocop/pull/2316"},"issue":{"href":"https://api.github.com/repos/bbatsov/rubocop/issues/2316"},"comments":{"href":"https://api.github.com/repos/bbatsov/rubocop/issues/2316/comments"},"review_comments":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316/comments"},"review_comment":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbatsov/rubocop/pulls/2316/commits"},"statuses":{"href":"https://api.github.com/repos/bbatsov/rubocop/statuses/a979e58c9dd614e6601d2688606e660dcbd144d5"}}}}