{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/1769","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1769/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1769/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1769/events","html_url":"https://github.com/bbatsov/rubocop/issues/1769","id":66978926,"number":1769,"title":"LiteralInInterpolation false positive when interpolating \"#{__LINE__}\"","user":{"login":"rrosenblum","id":1528852,"avatar_url":"https://avatars.githubusercontent.com/u/1528852?v=3","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,"milestone":null,"comments":2,"created_at":"2015-04-07T20:02:17Z","updated_at":"2015-04-08T05:50:18Z","closed_at":null,"body":"I just upgraded to RuboCop 0.30.0 and ran into a false positive when running LiteralInInterpolation.\r\n\r\nHere is a test that exercises the bug.\r\n```ruby\r\nit 'accepts strings like __LINE__' do\r\n  inspect_source(cop, '\"this is #{__LINE__} silly\"')\r\n  expect(cop.offenses).to be_empty\r\nend\r\n\r\n\r\n1) RuboCop::Cop::Lint::LiteralInInterpolation accepts strings like __LINE__\r\n     Failure/Error: expect(cop.offenses).to be_empty\r\n       expected `[W:  1: 12: Literal interpolation detected.].empty?` to return true, got false\r\n```\r\n\r\nI will try to find a fix for the issue, but in the mean time, I wanted to bring exposure to the bug."},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/90808771","html_url":"https://github.com/bbatsov/rubocop/issues/1769#issuecomment-90808771","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/1769","id":90808771,"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},"created_at":"2015-04-08T05:50:18Z","updated_at":"2015-04-08T05:50:18Z","body":"I think you must look at the actual source to sort out this special case.\r\n```ruby\r\nnode.loc.expression.is?('__LINE__')\r\n```"}}