{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/5815","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5815/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5815/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5815/events","html_url":"https://github.com/bbatsov/rubocop/issues/5815","id":317350873,"number":5815,"title":"False positive Style/FormatStringToken error with scan regex","user":{"login":"jcavalieri","id":2171614,"avatar_url":"https://avatars0.githubusercontent.com/u/2171614?v=4","gravatar_id":"","url":"https://api.github.com/users/jcavalieri","html_url":"https://github.com/jcavalieri","followers_url":"https://api.github.com/users/jcavalieri/followers","following_url":"https://api.github.com/users/jcavalieri/following{/other_user}","gists_url":"https://api.github.com/users/jcavalieri/gists{/gist_id}","starred_url":"https://api.github.com/users/jcavalieri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcavalieri/subscriptions","organizations_url":"https://api.github.com/users/jcavalieri/orgs","repos_url":"https://api.github.com/users/jcavalieri/repos","events_url":"https://api.github.com/users/jcavalieri/events{/privacy}","received_events_url":"https://api.github.com/users/jcavalieri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-24T18:49:35Z","updated_at":"2018-04-25T13:37:16Z","closed_at":"2018-04-25T13:37:16Z","author_association":"NONE","body":"Rubocop is misidentifying a scan regex as string formatting.\r\n\r\n--------\r\n\r\n## Expected behavior\r\n\r\nFor the following ...\r\n```\r\n  def test(template)\r\n    template.scan(/%{(?<variable>[^}]*)}/) { matches << $LAST_MATCH_INFO }\r\n  end\r\n```\r\n... expect no string format error\r\n\r\n## Actual behavior\r\n\r\nGetting the following error:\r\n```\r\nStyle/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).\r\n    template.scan(/%{(?<variable>[^}]*)}/) { matches << $LAST_MATCH_INFO }\r\n                   ^^^^^^^^^^^^^^^^^\r\n```\r\n\r\n## Steps to reproduce the problem\r\n\r\n`rubocop -a`\r\n\r\nThis is extremely important! Providing us with a reliable way to reproduce\r\na problem will expedite its solution.\r\n\r\n## RuboCop version\r\n\r\n```\r\n0.51.0 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-linux)\r\n```\r\n\r\nAlso failed with the latest: 0.55.0\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/384289114","html_url":"https://github.com/bbatsov/rubocop/issues/5815#issuecomment-384289114","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5815","id":384289114,"user":{"login":"Drenmi","id":5259935,"avatar_url":"https://avatars1.githubusercontent.com/u/5259935?v=4","gravatar_id":"","url":"https://api.github.com/users/Drenmi","html_url":"https://github.com/Drenmi","followers_url":"https://api.github.com/users/Drenmi/followers","following_url":"https://api.github.com/users/Drenmi/following{/other_user}","gists_url":"https://api.github.com/users/Drenmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Drenmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drenmi/subscriptions","organizations_url":"https://api.github.com/users/Drenmi/orgs","repos_url":"https://api.github.com/users/Drenmi/repos","events_url":"https://api.github.com/users/Drenmi/events{/privacy}","received_events_url":"https://api.github.com/users/Drenmi/received_events","type":"User","site_admin":false},"created_at":"2018-04-25T13:37:16Z","updated_at":"2018-04-25T13:37:16Z","author_association":"COLLABORATOR","body":"Fixed in 0.52.1, and unable to reproduce on any version after that."}}
{"actor":{"display_login":"Drenmi"}}