{"action":"created","comment":{"url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/comments/34273815","id":34273815,"diff_hunk":"@@ -1,8 +1,50 @@\n+{BufferedProcess, CompositeDisposable} = require 'atom'\n+\n module.exports =\n+\n   config:\n     javaExecutablePath:\n       type: 'string'\n-      default: ''\n+      title: 'Path to the javac executable'\n+      default: '/usr/bin/javac'\n \n   activate: ->\n-    console.log 'activate linter-javac'\n+    @subscriptions = new CompositeDisposable\n+    @subscriptions.add atom.config.observe 'linter-javac.javaExecutablePath',\n+      (newValue) =>\n+        @javaExecutablePath = newValue\n+\n+  deactivate: ->\n+    @subscriptions.dispose()\n+\n+  provideLinter: ->\n+    grammarScopes: ['source.java']\n+    scope: 'file'\n+    lintOnFly: true\n+    lint: (textEditor) =>\n+      return new Promise (resolve, reject) =>\n+        filePath = textEditor.getPath()\n+        messages = []\n+        process = new BufferedProcess\n+          command: @javaExecutablePath\n+          args: ['-Xlint:all', filePath]\n+          stderr: (data) ->\n+            # Regex to match the entire error/warning message including the caret (^)\n+            # that points to the location of the issue in the source line.\n+            regex = /java:(\\d+): (error|warning): (.+)\\r?\\n.*\\r?\\n( *)\\^/g","path":"lib/init.coffee","position":36,"original_position":36,"commit_id":"28399e76a3d54857b7a1978a2692a6e937ce1f6a","original_commit_id":"28399e76a3d54857b7a1978a2692a6e937ce1f6a","user":{"login":"daw42","id":924004,"avatar_url":"https://avatars.githubusercontent.com/u/924004?v=3","gravatar_id":"","url":"https://api.github.com/users/daw42","html_url":"https://github.com/daw42","followers_url":"https://api.github.com/users/daw42/followers","following_url":"https://api.github.com/users/daw42/following{/other_user}","gists_url":"https://api.github.com/users/daw42/gists{/gist_id}","starred_url":"https://api.github.com/users/daw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daw42/subscriptions","organizations_url":"https://api.github.com/users/daw42/orgs","repos_url":"https://api.github.com/users/daw42/repos","events_url":"https://api.github.com/users/daw42/events{/privacy}","received_events_url":"https://api.github.com/users/daw42/received_events","type":"User","site_admin":false},"body":"Thanks!  I had considered using a block regex, to add comments and help make it more readable, but unfortunately, it doesn't look like we can use literal spaces within a block regex (https://github.com/jashkenas/coffeescript/issues/1199, https://github.com/jashkenas/coffeescript/issues/1668).  We can use `\\x20`, but that makes it less readable.","created_at":"2015-07-09T16:27:09Z","updated_at":"2015-07-09T16:27:09Z","html_url":"https://github.com/AtomLinter/linter-javac/pull/23#discussion_r34273815","pull_request_url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/comments/34273815"},"html":{"href":"https://github.com/AtomLinter/linter-javac/pull/23#discussion_r34273815"},"pull_request":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23","id":39547783,"html_url":"https://github.com/AtomLinter/linter-javac/pull/23","diff_url":"https://github.com/AtomLinter/linter-javac/pull/23.diff","patch_url":"https://github.com/AtomLinter/linter-javac/pull/23.patch","issue_url":"https://api.github.com/repos/AtomLinter/linter-javac/issues/23","number":23,"state":"open","locked":false,"title":"Port to linter-plus","user":{"login":"daw42","id":924004,"avatar_url":"https://avatars.githubusercontent.com/u/924004?v=3","gravatar_id":"","url":"https://api.github.com/users/daw42","html_url":"https://github.com/daw42","followers_url":"https://api.github.com/users/daw42/followers","following_url":"https://api.github.com/users/daw42/following{/other_user}","gists_url":"https://api.github.com/users/daw42/gists{/gist_id}","starred_url":"https://api.github.com/users/daw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daw42/subscriptions","organizations_url":"https://api.github.com/users/daw42/orgs","repos_url":"https://api.github.com/users/daw42/repos","events_url":"https://api.github.com/users/daw42/events{/privacy}","received_events_url":"https://api.github.com/users/daw42/received_events","type":"User","site_admin":false},"body":"This pull request ports linter javac to the new Linter API.  \r\n\r\nIt also uses a longer regular expression to extract the column number for errors and warnings.\r\n\r\nThis pull request relates to issue #20.","created_at":"2015-07-09T04:44:51Z","updated_at":"2015-07-09T16:27:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"397fe176fbd95959488133b10bb9cf3c40d92a22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23/commits","review_comments_url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23/comments","review_comment_url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AtomLinter/linter-javac/issues/23/comments","statuses_url":"https://api.github.com/repos/AtomLinter/linter-javac/statuses/28399e76a3d54857b7a1978a2692a6e937ce1f6a","head":{"label":"daw42:linter-plus","ref":"linter-plus","sha":"28399e76a3d54857b7a1978a2692a6e937ce1f6a","user":{"login":"daw42","id":924004,"avatar_url":"https://avatars.githubusercontent.com/u/924004?v=3","gravatar_id":"","url":"https://api.github.com/users/daw42","html_url":"https://github.com/daw42","followers_url":"https://api.github.com/users/daw42/followers","following_url":"https://api.github.com/users/daw42/following{/other_user}","gists_url":"https://api.github.com/users/daw42/gists{/gist_id}","starred_url":"https://api.github.com/users/daw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daw42/subscriptions","organizations_url":"https://api.github.com/users/daw42/orgs","repos_url":"https://api.github.com/users/daw42/repos","events_url":"https://api.github.com/users/daw42/events{/privacy}","received_events_url":"https://api.github.com/users/daw42/received_events","type":"User","site_admin":false},"repo":{"id":38783265,"name":"linter-javac","full_name":"daw42/linter-javac","owner":{"login":"daw42","id":924004,"avatar_url":"https://avatars.githubusercontent.com/u/924004?v=3","gravatar_id":"","url":"https://api.github.com/users/daw42","html_url":"https://github.com/daw42","followers_url":"https://api.github.com/users/daw42/followers","following_url":"https://api.github.com/users/daw42/following{/other_user}","gists_url":"https://api.github.com/users/daw42/gists{/gist_id}","starred_url":"https://api.github.com/users/daw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daw42/subscriptions","organizations_url":"https://api.github.com/users/daw42/orgs","repos_url":"https://api.github.com/users/daw42/repos","events_url":"https://api.github.com/users/daw42/events{/privacy}","received_events_url":"https://api.github.com/users/daw42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daw42/linter-javac","description":"Lint Java on the fly, with javac","fork":true,"url":"https://api.github.com/repos/daw42/linter-javac","forks_url":"https://api.github.com/repos/daw42/linter-javac/forks","keys_url":"https://api.github.com/repos/daw42/linter-javac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daw42/linter-javac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daw42/linter-javac/teams","hooks_url":"https://api.github.com/repos/daw42/linter-javac/hooks","issue_events_url":"https://api.github.com/repos/daw42/linter-javac/issues/events{/number}","events_url":"https://api.github.com/repos/daw42/linter-javac/events","assignees_url":"https://api.github.com/repos/daw42/linter-javac/assignees{/user}","branches_url":"https://api.github.com/repos/daw42/linter-javac/branches{/branch}","tags_url":"https://api.github.com/repos/daw42/linter-javac/tags","blobs_url":"https://api.github.com/repos/daw42/linter-javac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daw42/linter-javac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daw42/linter-javac/git/refs{/sha}","trees_url":"https://api.github.com/repos/daw42/linter-javac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daw42/linter-javac/statuses/{sha}","languages_url":"https://api.github.com/repos/daw42/linter-javac/languages","stargazers_url":"https://api.github.com/repos/daw42/linter-javac/stargazers","contributors_url":"https://api.github.com/repos/daw42/linter-javac/contributors","subscribers_url":"https://api.github.com/repos/daw42/linter-javac/subscribers","subscription_url":"https://api.github.com/repos/daw42/linter-javac/subscription","commits_url":"https://api.github.com/repos/daw42/linter-javac/commits{/sha}","git_commits_url":"https://api.github.com/repos/daw42/linter-javac/git/commits{/sha}","comments_url":"https://api.github.com/repos/daw42/linter-javac/comments{/number}","issue_comment_url":"https://api.github.com/repos/daw42/linter-javac/issues/comments{/number}","contents_url":"https://api.github.com/repos/daw42/linter-javac/contents/{+path}","compare_url":"https://api.github.com/repos/daw42/linter-javac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daw42/linter-javac/merges","archive_url":"https://api.github.com/repos/daw42/linter-javac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daw42/linter-javac/downloads","issues_url":"https://api.github.com/repos/daw42/linter-javac/issues{/number}","pulls_url":"https://api.github.com/repos/daw42/linter-javac/pulls{/number}","milestones_url":"https://api.github.com/repos/daw42/linter-javac/milestones{/number}","notifications_url":"https://api.github.com/repos/daw42/linter-javac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daw42/linter-javac/labels{/name}","releases_url":"https://api.github.com/repos/daw42/linter-javac/releases{/id}","created_at":"2015-07-08T22:23:49Z","updated_at":"2015-07-08T22:23:49Z","pushed_at":"2015-07-09T04:40:26Z","git_url":"git://github.com/daw42/linter-javac.git","ssh_url":"git@github.com:daw42/linter-javac.git","clone_url":"https://github.com/daw42/linter-javac.git","svn_url":"https://github.com/daw42/linter-javac","homepage":null,"size":86,"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":"9b0780b753636a09d6daa3e238956060f15d39bb","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":19895421,"name":"linter-javac","full_name":"AtomLinter/linter-javac","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-javac","description":"Lint Java on the fly, with javac","fork":false,"url":"https://api.github.com/repos/AtomLinter/linter-javac","forks_url":"https://api.github.com/repos/AtomLinter/linter-javac/forks","keys_url":"https://api.github.com/repos/AtomLinter/linter-javac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AtomLinter/linter-javac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AtomLinter/linter-javac/teams","hooks_url":"https://api.github.com/repos/AtomLinter/linter-javac/hooks","issue_events_url":"https://api.github.com/repos/AtomLinter/linter-javac/issues/events{/number}","events_url":"https://api.github.com/repos/AtomLinter/linter-javac/events","assignees_url":"https://api.github.com/repos/AtomLinter/linter-javac/assignees{/user}","branches_url":"https://api.github.com/repos/AtomLinter/linter-javac/branches{/branch}","tags_url":"https://api.github.com/repos/AtomLinter/linter-javac/tags","blobs_url":"https://api.github.com/repos/AtomLinter/linter-javac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AtomLinter/linter-javac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AtomLinter/linter-javac/git/refs{/sha}","trees_url":"https://api.github.com/repos/AtomLinter/linter-javac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AtomLinter/linter-javac/statuses/{sha}","languages_url":"https://api.github.com/repos/AtomLinter/linter-javac/languages","stargazers_url":"https://api.github.com/repos/AtomLinter/linter-javac/stargazers","contributors_url":"https://api.github.com/repos/AtomLinter/linter-javac/contributors","subscribers_url":"https://api.github.com/repos/AtomLinter/linter-javac/subscribers","subscription_url":"https://api.github.com/repos/AtomLinter/linter-javac/subscription","commits_url":"https://api.github.com/repos/AtomLinter/linter-javac/commits{/sha}","git_commits_url":"https://api.github.com/repos/AtomLinter/linter-javac/git/commits{/sha}","comments_url":"https://api.github.com/repos/AtomLinter/linter-javac/comments{/number}","issue_comment_url":"https://api.github.com/repos/AtomLinter/linter-javac/issues/comments{/number}","contents_url":"https://api.github.com/repos/AtomLinter/linter-javac/contents/{+path}","compare_url":"https://api.github.com/repos/AtomLinter/linter-javac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AtomLinter/linter-javac/merges","archive_url":"https://api.github.com/repos/AtomLinter/linter-javac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AtomLinter/linter-javac/downloads","issues_url":"https://api.github.com/repos/AtomLinter/linter-javac/issues{/number}","pulls_url":"https://api.github.com/repos/AtomLinter/linter-javac/pulls{/number}","milestones_url":"https://api.github.com/repos/AtomLinter/linter-javac/milestones{/number}","notifications_url":"https://api.github.com/repos/AtomLinter/linter-javac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AtomLinter/linter-javac/labels{/name}","releases_url":"https://api.github.com/repos/AtomLinter/linter-javac/releases{/id}","created_at":"2014-05-17T20:20:03Z","updated_at":"2015-04-12T21:17:50Z","pushed_at":"2015-07-09T04:44:51Z","git_url":"git://github.com/AtomLinter/linter-javac.git","ssh_url":"git@github.com:AtomLinter/linter-javac.git","clone_url":"https://github.com/AtomLinter/linter-javac.git","svn_url":"https://github.com/AtomLinter/linter-javac","homepage":null,"size":374,"stargazers_count":8,"watchers_count":8,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":11,"forks":11,"open_issues":11,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23"},"html":{"href":"https://github.com/AtomLinter/linter-javac/pull/23"},"issue":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/issues/23"},"comments":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/AtomLinter/linter-javac/statuses/28399e76a3d54857b7a1978a2692a6e937ce1f6a"}}}}