{"action":"created","issue":{"url":"https://api.github.com/repos/github/linguist/issues/2448","labels_url":"https://api.github.com/repos/github/linguist/issues/2448/labels{/name}","comments_url":"https://api.github.com/repos/github/linguist/issues/2448/comments","events_url":"https://api.github.com/repos/github/linguist/issues/2448/events","html_url":"https://github.com/github/linguist/pull/2448","id":87171471,"number":2448,"title":"Tighten RenderScript/Rust disambiguation","user":{"login":"chris-morgan","id":392868,"avatar_url":"https://avatars.githubusercontent.com/u/392868?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-morgan","html_url":"https://github.com/chris-morgan","followers_url":"https://api.github.com/users/chris-morgan/followers","following_url":"https://api.github.com/users/chris-morgan/following{/other_user}","gists_url":"https://api.github.com/users/chris-morgan/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-morgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-morgan/subscriptions","organizations_url":"https://api.github.com/users/chris-morgan/orgs","repos_url":"https://api.github.com/users/chris-morgan/repos","events_url":"https://api.github.com/users/chris-morgan/events{/privacy}","received_events_url":"https://api.github.com/users/chris-morgan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-11T01:46:51Z","updated_at":"2015-06-11T09:26:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/github/linguist/pulls/2448","html_url":"https://github.com/github/linguist/pull/2448","diff_url":"https://github.com/github/linguist/pull/2448.diff","patch_url":"https://github.com/github/linguist/pull/2448.patch"},"body":"RenderScript files are required to have `#pragma version(1)`, and only someone deliberately trying to mislead a filetype classifier will put it in Rust code at the start of a line, so that really is the only check needed, and defaulting to Rust is then sound.\r\n\r\nThis follows on from #2424; #2425 fixed the immediate problem, but this provides a better classification; it’s entirely possible to have a Rust file with only constants defined, for example, which the previous check would fail to catch.\r\n\r\nThese heuristics are [the same as ohcount’s][1], which were [discussed at some length][2].\r\n\r\n[1]: https://github.com/blackducksw/ohcount/blob/d54514399013f2f9566baf40edd0e801b27fe17b/src/detector.c#L870..L897\r\n[2]: https://github.com/blackducksw/ohcount/pull/30"},"comment":{"url":"https://api.github.com/repos/github/linguist/issues/comments/111060364","html_url":"https://github.com/github/linguist/pull/2448#issuecomment-111060364","issue_url":"https://api.github.com/repos/github/linguist/issues/2448","id":111060364,"user":{"login":"larsbrinkhoff","id":775050,"avatar_url":"https://avatars.githubusercontent.com/u/775050?v=3","gravatar_id":"","url":"https://api.github.com/users/larsbrinkhoff","html_url":"https://github.com/larsbrinkhoff","followers_url":"https://api.github.com/users/larsbrinkhoff/followers","following_url":"https://api.github.com/users/larsbrinkhoff/following{/other_user}","gists_url":"https://api.github.com/users/larsbrinkhoff/gists{/gist_id}","starred_url":"https://api.github.com/users/larsbrinkhoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsbrinkhoff/subscriptions","organizations_url":"https://api.github.com/users/larsbrinkhoff/orgs","repos_url":"https://api.github.com/users/larsbrinkhoff/repos","events_url":"https://api.github.com/users/larsbrinkhoff/events{/privacy}","received_events_url":"https://api.github.com/users/larsbrinkhoff/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T09:26:27Z","updated_at":"2015-06-11T09:26:27Z","body":"@chris-morgan If you want to examine the samples yourself, I can send you a zip file."}}