{"action":"created","issue":{"url":"https://api.github.com/repos/gotwarlost/istanbul/issues/295","labels_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/295/comments","events_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/295/events","html_url":"https://github.com/gotwarlost/istanbul/issues/295","id":53571068,"number":295,"title":"CoffeeScript support","user":{"login":"jwalton","id":1771003,"avatar_url":"https://avatars.githubusercontent.com/u/1771003?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalton","html_url":"https://github.com/jwalton","followers_url":"https://api.github.com/users/jwalton/followers","following_url":"https://api.github.com/users/jwalton/following{/other_user}","gists_url":"https://api.github.com/users/jwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalton/subscriptions","organizations_url":"https://api.github.com/users/jwalton/orgs","repos_url":"https://api.github.com/users/jwalton/repos","events_url":"https://api.github.com/users/jwalton/events{/privacy}","received_events_url":"https://api.github.com/users/jwalton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-06T22:19:25Z","updated_at":"2015-04-23T16:33:08Z","closed_at":null,"body":"Hi!  I'm the author of [coffee-coverage](https://github.com/benbria/coffee-coverage).  I've had some interest in getting coffee-coverage and istanbul working together, and was wondering if you had some input on what the best way to do such a thing would be?\r\n\r\nCoffee-coverage was written to have output that's compatible with [jscoverage](http://siliconforks.com/jscoverage/), so it doesn't do any branch or function coverage (because jscoverage doesn't) but these features would be pretty easy to add (@silkentrance is [working on this right now](https://github.com/benbria/coffee-coverage/pull/34) in fact.)\r\n\r\nWhat's the easiest way to get data from coffee-coverage into instanbul, though?"},"comment":{"url":"https://api.github.com/repos/gotwarlost/istanbul/issues/comments/95646003","html_url":"https://github.com/gotwarlost/istanbul/issues/295#issuecomment-95646003","issue_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/295","id":95646003,"user":{"login":"jwalton","id":1771003,"avatar_url":"https://avatars.githubusercontent.com/u/1771003?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalton","html_url":"https://github.com/jwalton","followers_url":"https://api.github.com/users/jwalton/followers","following_url":"https://api.github.com/users/jwalton/following{/other_user}","gists_url":"https://api.github.com/users/jwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalton/subscriptions","organizations_url":"https://api.github.com/users/jwalton/orgs","repos_url":"https://api.github.com/users/jwalton/repos","events_url":"https://api.github.com/users/jwalton/events{/privacy}","received_events_url":"https://api.github.com/users/jwalton/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T16:33:08Z","updated_at":"2015-04-23T16:33:08Z","body":"Here's my attempt at reverse engineering the coverage.json object:\r\n\r\n# JSON Report Format\r\n\r\nTop level is a hash where keys are file names, and values are coverage data for that file\r\n(the result of `json.stringify(collector.fileCoverageFor(filename))`)  Each coverage data consists of:\r\n\r\n* `path` - The path to the file.\r\n* `s` - Hash of statement counts, where keys as statement IDs.\r\n* `b` - Hash of branch counts, where keys are branch IDs and values are arrays of counts.\r\n        For an if statement, the value would have two counts; one for the if, and one for the else.\r\n        Switch statements would have an array of values for each case.\r\n* `f` - Hash of function counts, where keys are function IDs.\r\n* `fnMap` - Hash of functions where keys are function IDs, and values are `{name, line, loc}`,\r\n   where `name` is the name of the function, `line` is the line the function is declared on,\r\n   and `loc` is the `Location` of the function declaration (just the declaration, not the entire\r\n   function body.)\r\n* `statementMap` - Hash where keys are statement IDs, and values are `Location` objects for each\r\n  statement.\r\n* `branchMap` - Hash where keys are branch IDs, and values are `{line, type, locations}` objects.\r\n  `line` is the line the branch starts on.  `type` is the type of the branch (e.g. \"if\", \"switch\").\r\n  `locations` is an array of `Location` objects, one for each possible outcome of the branch.\r\n  Note for an `if` statement where there is no `else` clause, there will still be two `locations`\r\n  generated.  Instanbul does *not* generate coverage for the `default` case of a switch statement\r\n  if `default` is not explicitly present in the source code.\r\n\r\n  `locations` for an if statement are always 0-length and located at the start of the `if` (even\r\n  the location for the \"else\").  For a `switch` statement, `locations` start at the start of the\r\n  `case` statement and go to the end of the line before the next case statement (note Instanbul\r\n  does nothing clever here if a `case` is missing a `break`.)\r\n\r\n## Location Objects\r\n\r\nLocation objects are a `{start: {line, column}, end: {line, column}}` object that describes the\r\nstart and end of a piece of code.  Note that `line` is 1-based, but `column` is 0-based."}}