{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/2203","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/2203/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/2203/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/2203/events","html_url":"https://github.com/facebook/flow/issues/2203","id":169798619,"number":2203,"title":"Add `projectRoot` attribute in `flow --json` output","user":{"login":"ryyppy","id":1121889,"avatar_url":"https://avatars.githubusercontent.com/u/1121889?v=3","gravatar_id":"","url":"https://api.github.com/users/ryyppy","html_url":"https://github.com/ryyppy","followers_url":"https://api.github.com/users/ryyppy/followers","following_url":"https://api.github.com/users/ryyppy/following{/other_user}","gists_url":"https://api.github.com/users/ryyppy/gists{/gist_id}","starred_url":"https://api.github.com/users/ryyppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryyppy/subscriptions","organizations_url":"https://api.github.com/users/ryyppy/orgs","repos_url":"https://api.github.com/users/ryyppy/repos","events_url":"https://api.github.com/users/ryyppy/events{/privacy}","received_events_url":"https://api.github.com/users/ryyppy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-07T14:22:55Z","updated_at":"2016-08-07T14:42:32Z","closed_at":null,"body":"Right now, I am building a tool for parsing `flow --json` and format the output to a VIM quickfix window friendly format.\r\n\r\nMy problem is that I get only absolute paths for files causing a flow error, which will lead to messages like this:\r\n\r\n```\r\n/Users/me/Projects/test/redux-saga_0.9.5.js:26:5,29: $npm$ReduxSaga$CallEffect | Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)\r\n```\r\n\r\nSince some messages can get really long (in one line), I would like to have the possibility to strip the first part of the path and only report relative paths to the given project directory, like this:\r\n\r\n```\r\ntest/redux-saga_0.9.5.js:26:5,29: $npm$ReduxSaga$CallEffect | Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)\r\n```\r\n\r\nTo accomplish this, I need to determine the root directory of the project (something I assume the flow server is aware of). Of course, I could calculate this path on my own (VIML etc.), but I think it would be much more consistent (and useful for other tools), to get the `projectRoot` right away in the `flow --json` output like this:\r\n\r\n```\r\n{\r\n  \"flowVersion\": \"0.30.0\",\r\n  \"errors\":[],\r\n  \"passed\":true,\r\n  \"projectRoot\": \"/Users/me/Projects/flow-vim-quickfix\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/238086326","html_url":"https://github.com/facebook/flow/issues/2203#issuecomment-238086326","issue_url":"https://api.github.com/repos/facebook/flow/issues/2203","id":238086326,"user":{"login":"ryyppy","id":1121889,"avatar_url":"https://avatars.githubusercontent.com/u/1121889?v=3","gravatar_id":"","url":"https://api.github.com/users/ryyppy","html_url":"https://github.com/ryyppy","followers_url":"https://api.github.com/users/ryyppy/followers","following_url":"https://api.github.com/users/ryyppy/following{/other_user}","gists_url":"https://api.github.com/users/ryyppy/gists{/gist_id}","starred_url":"https://api.github.com/users/ryyppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryyppy/subscriptions","organizations_url":"https://api.github.com/users/ryyppy/orgs","repos_url":"https://api.github.com/users/ryyppy/repos","events_url":"https://api.github.com/users/ryyppy/events{/privacy}","received_events_url":"https://api.github.com/users/ryyppy/received_events","type":"User","site_admin":false},"created_at":"2016-08-07T14:42:32Z","updated_at":"2016-08-07T14:42:32Z","body":"@vkurchatkin I was also thinking about that... for my use-case this would also be sufficient. But I reckon a `--strip-root` is much harder to implement?"}}
{"actor":{"display_login":"ryyppy"}}