{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/5911","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5911/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5911/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5911/events","html_url":"https://github.com/bbatsov/rubocop/pull/5911","id":325830511,"number":5911,"title":"Frozen string literal comment space","user":{"login":"rrosenblum","id":1528852,"avatar_url":"https://avatars0.githubusercontent.com/u/1528852?v=4","gravatar_id":"","url":"https://api.github.com/users/rrosenblum","html_url":"https://github.com/rrosenblum","followers_url":"https://api.github.com/users/rrosenblum/followers","following_url":"https://api.github.com/users/rrosenblum/following{/other_user}","gists_url":"https://api.github.com/users/rrosenblum/gists{/gist_id}","starred_url":"https://api.github.com/users/rrosenblum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrosenblum/subscriptions","organizations_url":"https://api.github.com/users/rrosenblum/orgs","repos_url":"https://api.github.com/users/rrosenblum/repos","events_url":"https://api.github.com/users/rrosenblum/events{/privacy}","received_events_url":"https://api.github.com/users/rrosenblum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-23T18:51:32Z","updated_at":"2018-05-24T12:51:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/5911","html_url":"https://github.com/bbatsov/rubocop/pull/5911","diff_url":"https://github.com/bbatsov/rubocop/pull/5911.diff","patch_url":"https://github.com/bbatsov/rubocop/pull/5911.patch"},"body":"Given code that begins on the second line, the cop would correct the file to contain a new line on line 1 and the comment on line 2.\r\n```\r\ncat test.rb \r\n\r\nputs 1\r\n```\r\n```\r\ncat test.rb\r\n\r\n# frozen_string_literal: true\r\n\r\nputs 1\r\n```\r\n\r\n\r\nThere was also a bug where `Token#space_before?` would actually return space after if the token started at position 0. String position -1 is the last character of the string."},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/391702951","html_url":"https://github.com/bbatsov/rubocop/pull/5911#issuecomment-391702951","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5911","id":391702951,"user":{"login":"rrosenblum","id":1528852,"avatar_url":"https://avatars0.githubusercontent.com/u/1528852?v=4","gravatar_id":"","url":"https://api.github.com/users/rrosenblum","html_url":"https://github.com/rrosenblum","followers_url":"https://api.github.com/users/rrosenblum/followers","following_url":"https://api.github.com/users/rrosenblum/following{/other_user}","gists_url":"https://api.github.com/users/rrosenblum/gists{/gist_id}","starred_url":"https://api.github.com/users/rrosenblum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrosenblum/subscriptions","organizations_url":"https://api.github.com/users/rrosenblum/orgs","repos_url":"https://api.github.com/users/rrosenblum/repos","events_url":"https://api.github.com/users/rrosenblum/events{/privacy}","received_events_url":"https://api.github.com/users/rrosenblum/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T12:51:39Z","updated_at":"2018-05-24T12:51:39Z","author_association":"CONTRIBUTOR","body":"Looks like there is a bug with `rubocop-rspec` detecting duplicate test names. I'll update the test names to get this to pass and open a bug in `rubocop-rspec`.\r\n\r\n```\r\nspec/rubocop/cop/style/frozen_string_literal_comment_spec.rb:158:7: C: RSpec/RepeatedExample: Don't repeat examples within an example group.\r\n      it 'adds a frozen string literal comment to the first line if one is ' \\ ...\r\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nspec/rubocop/cop/style/frozen_string_literal_comment_spec.rb:171:7: C: RSpec/RepeatedExample: Don't repeat examples within an example group.\r\n      it 'adds a frozen string literal comment to the first line if one is ' \\ ...\r\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n``"}}
{"actor":{"display_login":"rrosenblum"}}