{"action":"created","comment":{"url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/comments/83972533","pull_request_review_id":4771320,"id":83972533,"diff_hunk":"@@ -0,0 +1,234 @@\n+XRegExp = require 'xregexp'\n+sb_exec = require 'sb-exec'\n+path = require 'path'\n+\n+pattern = XRegExp('(?<file>[^\\n\\r]+):(?<from_line>\\\\d+):(?<from_col>\\\\d+):\\\\s*\\\n+  (?<to_line>\\\\d+):(?<to_col>\\\\d+)\\\\s+\\\n+  ((?<error>error|fatal error)|(?<warning>warning)|(?<info>note|help)):\\\\s+\\\n+  (?<message>.+?)[\\n\\r]+($|(?=[^\\n\\r]+:\\\\d+))', 's')\n+\n+parseOldMessages = (output, disabledWarnings) ->\n+  elements = []\n+  XRegExp.forEach output, pattern, (match) ->\n+    if match.from_col == match.to_col\n+      match.to_col = parseInt(match.to_col) + 1","path":"lib/mode.coffee","position":14,"original_position":14,"commit_id":"1c2350625b59b0ebf204d0e6cd9579ff2ccf4a75","original_commit_id":"0843a00c20065f5a62a4970817bb395c2b8de4f9","user":{"login":"Arcanemagus","id":427137,"avatar_url":"https://avatars.githubusercontent.com/u/427137?v=3","gravatar_id":"","url":"https://api.github.com/users/Arcanemagus","html_url":"https://github.com/Arcanemagus","followers_url":"https://api.github.com/users/Arcanemagus/followers","following_url":"https://api.github.com/users/Arcanemagus/following{/other_user}","gists_url":"https://api.github.com/users/Arcanemagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Arcanemagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arcanemagus/subscriptions","organizations_url":"https://api.github.com/users/Arcanemagus/orgs","repos_url":"https://api.github.com/users/Arcanemagus/repos","events_url":"https://api.github.com/users/Arcanemagus/events{/privacy}","received_events_url":"https://api.github.com/users/Arcanemagus/received_events","type":"User","site_admin":false},"body":"💡 Situations like this are where [`atom-linter::rangeFromLineNumber`](https://github.com/steelbrain/atom-linter/blob/v8.0.0/src/index.js#L16) is great as it will automatically determine a range highlighitng the next \"word\", _as defined by the language_. So you can feed it a single point and it will generate a better range than just the single character. It would require some refactoring though as it requires access to the `TextEditor` of the file being linted.","created_at":"2016-10-18T23:30:37Z","updated_at":"2016-10-18T23:43:14Z","html_url":"https://github.com/AtomLinter/linter-rust/pull/84#discussion_r83972533","pull_request_url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/comments/83972533"},"html":{"href":"https://github.com/AtomLinter/linter-rust/pull/84#discussion_r83972533"},"pull_request":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84","id":89522655,"html_url":"https://github.com/AtomLinter/linter-rust/pull/84","diff_url":"https://github.com/AtomLinter/linter-rust/pull/84.diff","patch_url":"https://github.com/AtomLinter/linter-rust/pull/84.patch","issue_url":"https://api.github.com/repos/AtomLinter/linter-rust/issues/84","number":84,"state":"open","locked":false,"title":"Added a proper support for `cargo --message-format json`","user":{"login":"White-Oak","id":2813216,"avatar_url":"https://avatars.githubusercontent.com/u/2813216?v=3","gravatar_id":"","url":"https://api.github.com/users/White-Oak","html_url":"https://github.com/White-Oak","followers_url":"https://api.github.com/users/White-Oak/followers","following_url":"https://api.github.com/users/White-Oak/following{/other_user}","gists_url":"https://api.github.com/users/White-Oak/gists{/gist_id}","starred_url":"https://api.github.com/users/White-Oak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/White-Oak/subscriptions","organizations_url":"https://api.github.com/users/White-Oak/orgs","repos_url":"https://api.github.com/users/White-Oak/repos","events_url":"https://api.github.com/users/White-Oak/events{/privacy}","received_events_url":"https://api.github.com/users/White-Oak/received_events","type":"User","site_admin":false},"body":"Massively refactored code, so the error mode behaviour is less dependent on conditions and more polymorphic.\r\n\r\nI've tested this in all five modes that `linter-rust` currently supports:\r\n* Old rustc plain-text messages\r\n* Old cargo plain-text messages\r\n* Rustc json errors\r\n* Intermediate cargo json errors, enabled by `RUSTFLAGS`, that caused several problems and only enabled for a short ammount of time from AUgust to October 2016\r\n* Proper cargo json errors enabled by `--message-format json`, that are introduced by this PR\r\n\r\nIn short, I split the linter in two files: `linter-rust.coffee` and `mode.coffee`. The latter is now responsible on mode-specific interactions such as error parsing, arguments generating. \r\n\r\nFixes #77.\r\n\r\nAs far as I tested it, it works, but I, probably, need some review on code.","created_at":"2016-10-16T10:59:45Z","updated_at":"2016-10-19T00:00:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89881ecdff6af1e8b0fc714d2f285a573c3f7110","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84/commits","review_comments_url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84/comments","review_comment_url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AtomLinter/linter-rust/issues/84/comments","statuses_url":"https://api.github.com/repos/AtomLinter/linter-rust/statuses/1c2350625b59b0ebf204d0e6cd9579ff2ccf4a75","head":{"label":"White-Oak:cargo-json","ref":"cargo-json","sha":"1c2350625b59b0ebf204d0e6cd9579ff2ccf4a75","user":{"login":"White-Oak","id":2813216,"avatar_url":"https://avatars.githubusercontent.com/u/2813216?v=3","gravatar_id":"","url":"https://api.github.com/users/White-Oak","html_url":"https://github.com/White-Oak","followers_url":"https://api.github.com/users/White-Oak/followers","following_url":"https://api.github.com/users/White-Oak/following{/other_user}","gists_url":"https://api.github.com/users/White-Oak/gists{/gist_id}","starred_url":"https://api.github.com/users/White-Oak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/White-Oak/subscriptions","organizations_url":"https://api.github.com/users/White-Oak/orgs","repos_url":"https://api.github.com/users/White-Oak/repos","events_url":"https://api.github.com/users/White-Oak/events{/privacy}","received_events_url":"https://api.github.com/users/White-Oak/received_events","type":"User","site_admin":false},"repo":{"id":51746467,"name":"linter-rust","full_name":"White-Oak/linter-rust","owner":{"login":"White-Oak","id":2813216,"avatar_url":"https://avatars.githubusercontent.com/u/2813216?v=3","gravatar_id":"","url":"https://api.github.com/users/White-Oak","html_url":"https://github.com/White-Oak","followers_url":"https://api.github.com/users/White-Oak/followers","following_url":"https://api.github.com/users/White-Oak/following{/other_user}","gists_url":"https://api.github.com/users/White-Oak/gists{/gist_id}","starred_url":"https://api.github.com/users/White-Oak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/White-Oak/subscriptions","organizations_url":"https://api.github.com/users/White-Oak/orgs","repos_url":"https://api.github.com/users/White-Oak/repos","events_url":"https://api.github.com/users/White-Oak/events{/privacy}","received_events_url":"https://api.github.com/users/White-Oak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/White-Oak/linter-rust","description":"Linting your Rust-files in Atom, using rustc and cargo.","fork":true,"url":"https://api.github.com/repos/White-Oak/linter-rust","forks_url":"https://api.github.com/repos/White-Oak/linter-rust/forks","keys_url":"https://api.github.com/repos/White-Oak/linter-rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/White-Oak/linter-rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/White-Oak/linter-rust/teams","hooks_url":"https://api.github.com/repos/White-Oak/linter-rust/hooks","issue_events_url":"https://api.github.com/repos/White-Oak/linter-rust/issues/events{/number}","events_url":"https://api.github.com/repos/White-Oak/linter-rust/events","assignees_url":"https://api.github.com/repos/White-Oak/linter-rust/assignees{/user}","branches_url":"https://api.github.com/repos/White-Oak/linter-rust/branches{/branch}","tags_url":"https://api.github.com/repos/White-Oak/linter-rust/tags","blobs_url":"https://api.github.com/repos/White-Oak/linter-rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/White-Oak/linter-rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/White-Oak/linter-rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/White-Oak/linter-rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/White-Oak/linter-rust/statuses/{sha}","languages_url":"https://api.github.com/repos/White-Oak/linter-rust/languages","stargazers_url":"https://api.github.com/repos/White-Oak/linter-rust/stargazers","contributors_url":"https://api.github.com/repos/White-Oak/linter-rust/contributors","subscribers_url":"https://api.github.com/repos/White-Oak/linter-rust/subscribers","subscription_url":"https://api.github.com/repos/White-Oak/linter-rust/subscription","commits_url":"https://api.github.com/repos/White-Oak/linter-rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/White-Oak/linter-rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/White-Oak/linter-rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/White-Oak/linter-rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/White-Oak/linter-rust/contents/{+path}","compare_url":"https://api.github.com/repos/White-Oak/linter-rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/White-Oak/linter-rust/merges","archive_url":"https://api.github.com/repos/White-Oak/linter-rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/White-Oak/linter-rust/downloads","issues_url":"https://api.github.com/repos/White-Oak/linter-rust/issues{/number}","pulls_url":"https://api.github.com/repos/White-Oak/linter-rust/pulls{/number}","milestones_url":"https://api.github.com/repos/White-Oak/linter-rust/milestones{/number}","notifications_url":"https://api.github.com/repos/White-Oak/linter-rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/White-Oak/linter-rust/labels{/name}","releases_url":"https://api.github.com/repos/White-Oak/linter-rust/releases{/id}","deployments_url":"https://api.github.com/repos/White-Oak/linter-rust/deployments","created_at":"2016-02-15T10:00:51Z","updated_at":"2016-02-15T10:00:51Z","pushed_at":"2016-10-18T23:43:14Z","git_url":"git://github.com/White-Oak/linter-rust.git","ssh_url":"git@github.com:White-Oak/linter-rust.git","clone_url":"https://github.com/White-Oak/linter-rust.git","svn_url":"https://github.com/White-Oak/linter-rust","homepage":"","size":114,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AtomLinter:master","ref":"master","sha":"c0bc0ae0052ecc5b802b3f4e00c64d5d4de02ee5","user":{"login":"AtomLinter","id":7242824,"avatar_url":"https://avatars.githubusercontent.com/u/7242824?v=3","gravatar_id":"","url":"https://api.github.com/users/AtomLinter","html_url":"https://github.com/AtomLinter","followers_url":"https://api.github.com/users/AtomLinter/followers","following_url":"https://api.github.com/users/AtomLinter/following{/other_user}","gists_url":"https://api.github.com/users/AtomLinter/gists{/gist_id}","starred_url":"https://api.github.com/users/AtomLinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtomLinter/subscriptions","organizations_url":"https://api.github.com/users/AtomLinter/orgs","repos_url":"https://api.github.com/users/AtomLinter/repos","events_url":"https://api.github.com/users/AtomLinter/events{/privacy}","received_events_url":"https://api.github.com/users/AtomLinter/received_events","type":"Organization","site_admin":false},"repo":{"id":23772601,"name":"linter-rust","full_name":"AtomLinter/linter-rust","owner":{"login":"AtomLinter","id":7242824,"avatar_url":"https://avatars.githubusercontent.com/u/7242824?v=3","gravatar_id":"","url":"https://api.github.com/users/AtomLinter","html_url":"https://github.com/AtomLinter","followers_url":"https://api.github.com/users/AtomLinter/followers","following_url":"https://api.github.com/users/AtomLinter/following{/other_user}","gists_url":"https://api.github.com/users/AtomLinter/gists{/gist_id}","starred_url":"https://api.github.com/users/AtomLinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtomLinter/subscriptions","organizations_url":"https://api.github.com/users/AtomLinter/orgs","repos_url":"https://api.github.com/users/AtomLinter/repos","events_url":"https://api.github.com/users/AtomLinter/events{/privacy}","received_events_url":"https://api.github.com/users/AtomLinter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AtomLinter/linter-rust","description":"Linting your Rust-files in Atom, using rustc and cargo.","fork":false,"url":"https://api.github.com/repos/AtomLinter/linter-rust","forks_url":"https://api.github.com/repos/AtomLinter/linter-rust/forks","keys_url":"https://api.github.com/repos/AtomLinter/linter-rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AtomLinter/linter-rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AtomLinter/linter-rust/teams","hooks_url":"https://api.github.com/repos/AtomLinter/linter-rust/hooks","issue_events_url":"https://api.github.com/repos/AtomLinter/linter-rust/issues/events{/number}","events_url":"https://api.github.com/repos/AtomLinter/linter-rust/events","assignees_url":"https://api.github.com/repos/AtomLinter/linter-rust/assignees{/user}","branches_url":"https://api.github.com/repos/AtomLinter/linter-rust/branches{/branch}","tags_url":"https://api.github.com/repos/AtomLinter/linter-rust/tags","blobs_url":"https://api.github.com/repos/AtomLinter/linter-rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AtomLinter/linter-rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AtomLinter/linter-rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/AtomLinter/linter-rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AtomLinter/linter-rust/statuses/{sha}","languages_url":"https://api.github.com/repos/AtomLinter/linter-rust/languages","stargazers_url":"https://api.github.com/repos/AtomLinter/linter-rust/stargazers","contributors_url":"https://api.github.com/repos/AtomLinter/linter-rust/contributors","subscribers_url":"https://api.github.com/repos/AtomLinter/linter-rust/subscribers","subscription_url":"https://api.github.com/repos/AtomLinter/linter-rust/subscription","commits_url":"https://api.github.com/repos/AtomLinter/linter-rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/AtomLinter/linter-rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/AtomLinter/linter-rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/AtomLinter/linter-rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/AtomLinter/linter-rust/contents/{+path}","compare_url":"https://api.github.com/repos/AtomLinter/linter-rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AtomLinter/linter-rust/merges","archive_url":"https://api.github.com/repos/AtomLinter/linter-rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AtomLinter/linter-rust/downloads","issues_url":"https://api.github.com/repos/AtomLinter/linter-rust/issues{/number}","pulls_url":"https://api.github.com/repos/AtomLinter/linter-rust/pulls{/number}","milestones_url":"https://api.github.com/repos/AtomLinter/linter-rust/milestones{/number}","notifications_url":"https://api.github.com/repos/AtomLinter/linter-rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AtomLinter/linter-rust/labels{/name}","releases_url":"https://api.github.com/repos/AtomLinter/linter-rust/releases{/id}","deployments_url":"https://api.github.com/repos/AtomLinter/linter-rust/deployments","created_at":"2014-09-07T22:22:26Z","updated_at":"2016-10-10T19:35:17Z","pushed_at":"2016-10-18T23:43:14Z","git_url":"git://github.com/AtomLinter/linter-rust.git","ssh_url":"git@github.com:AtomLinter/linter-rust.git","clone_url":"https://github.com/AtomLinter/linter-rust.git","svn_url":"https://github.com/AtomLinter/linter-rust","homepage":"","size":117,"stargazers_count":31,"watchers_count":31,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":9,"forks":20,"open_issues":9,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84"},"html":{"href":"https://github.com/AtomLinter/linter-rust/pull/84"},"issue":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/issues/84"},"comments":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/AtomLinter/linter-rust/statuses/1c2350625b59b0ebf204d0e6cd9579ff2ccf4a75"}}}}
{"actor":{"display_login":"Arcanemagus"}}