{"action":"created","issue":{"url":"https://api.github.com/repos/lpil/dogma/issues/52","labels_url":"https://api.github.com/repos/lpil/dogma/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/lpil/dogma/issues/52/comments","events_url":"https://api.github.com/repos/lpil/dogma/issues/52/events","html_url":"https://github.com/lpil/dogma/issues/52","id":93110357,"number":52,"title":"How do we avoid mistaking string contents for Elixir code?","user":{"login":"lpil","id":6134406,"avatar_url":"https://avatars.githubusercontent.com/u/6134406?v=3","gravatar_id":"","url":"https://api.github.com/users/lpil","html_url":"https://github.com/lpil","followers_url":"https://api.github.com/users/lpil/followers","following_url":"https://api.github.com/users/lpil/following{/other_user}","gists_url":"https://api.github.com/users/lpil/gists{/gist_id}","starred_url":"https://api.github.com/users/lpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpil/subscriptions","organizations_url":"https://api.github.com/users/lpil/orgs","repos_url":"https://api.github.com/users/lpil/repos","events_url":"https://api.github.com/users/lpil/events{/privacy}","received_events_url":"https://api.github.com/users/lpil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lpil/dogma/labels/Kind:%20Discussion","name":"Kind: Discussion","color":"ffb0cf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-05T13:11:58Z","updated_at":"2015-07-16T08:13:15Z","closed_at":null,"body":"There are times were we cannot get enough information from the AST alone, in which case we need to inspect the source of the script itself.\r\n\r\nWhen doing this, it's easy to mistake the contents of a string for code, resulting in false positives.\r\n\r\nFor example, if we wanted to ensure that the `+` operator always had a space around it, this code should not register any errors\r\n\r\n```elixir\r\n(String.graphemes(\"4+5\") |> length) + 5\r\n```\r\n\r\nBut unless we have a way of telling that it's in a string, we probably will probably get a false positive.\r\n\r\nWhat about code in heredocs, or multi line strings?\r\n\r\n```elixir\r\ndefmodule Foo do\r\n  \"\"\"\r\n  defmodule Bar do\r\n    Uh oh, what's going on here?\r\n  end\r\n  \"\"\"\r\nend\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lpil/dogma/issues/comments/121872873","html_url":"https://github.com/lpil/dogma/issues/52#issuecomment-121872873","issue_url":"https://api.github.com/repos/lpil/dogma/issues/52","id":121872873,"user":{"login":"lpil","id":6134406,"avatar_url":"https://avatars.githubusercontent.com/u/6134406?v=3","gravatar_id":"","url":"https://api.github.com/users/lpil","html_url":"https://github.com/lpil","followers_url":"https://api.github.com/users/lpil/followers","following_url":"https://api.github.com/users/lpil/following{/other_user}","gists_url":"https://api.github.com/users/lpil/gists{/gist_id}","starred_url":"https://api.github.com/users/lpil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpil/subscriptions","organizations_url":"https://api.github.com/users/lpil/orgs","repos_url":"https://api.github.com/users/lpil/repos","events_url":"https://api.github.com/users/lpil/events{/privacy}","received_events_url":"https://api.github.com/users/lpil/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T08:13:15Z","updated_at":"2015-07-16T08:13:15Z","body":"I'm not sure I follow, could you explain in more detail please?\r\n\r\nMy current thought was maybe trying to extract the Erlang tokeniser from the Elixir lang project."}}