{"action":"created","comment":{"url":"https://api.github.com/repos/github/linguist/pulls/comments/24255160","id":24255160,"diff_hunk":"@@ -223,5 +223,30 @@ def call(data)\n         Language[\"Text\"]\n       end\n     end\n+    disambiguate \"PLSQL\", \"SQLPL\", \"PLpgSQL\", \"SQL\" do |data|\n+      match = nil \n+      #unique keywords for each language\n+      plpgsqlkeywords = [/^\\\\i\\b/i, /begin ?(work|transaction)?;/i , /AS \\$\\$/i, /RAISE EXCEPTION/i, /LANGUAGE plpgsql\\b/i ]\n+      plsqlkeywords = [ /pragma\\b/i , /constructor\\W+function\\b/i]\n+      #sqlplkeywords = [  ]\n+\n+      #common keywords that are not SQL\n+      plkeywords = [/begin\\b/i,/boolean\\b/i, /package\\b/i,/exception\\b/i, /^end;\\b/i ]\n+\n+      re = Regexp.union(plpgsqlkeywords)\n+      if data.match(re)","path":"lib/linguist/heuristics.rb","position":15,"original_position":15,"commit_id":"3e54d6651caab999f8827c46d60889c27f02af93","original_commit_id":"3e54d6651caab999f8827c46d60889c27f02af93","user":{"login":"arfon","id":4483,"avatar_url":"https://avatars.githubusercontent.com/u/4483?v=3","gravatar_id":"","url":"https://api.github.com/users/arfon","html_url":"https://github.com/arfon","followers_url":"https://api.github.com/users/arfon/followers","following_url":"https://api.github.com/users/arfon/following{/other_user}","gists_url":"https://api.github.com/users/arfon/gists{/gist_id}","starred_url":"https://api.github.com/users/arfon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arfon/subscriptions","organizations_url":"https://api.github.com/users/arfon/orgs","repos_url":"https://api.github.com/users/arfon/repos","events_url":"https://api.github.com/users/arfon/events{/privacy}","received_events_url":"https://api.github.com/users/arfon/received_events","type":"User","site_admin":true},"body":"It would be great to see this written more like the current heuristics. Take a look at [this one](https://github.com/github/linguist/blob/7a141a923c4d0aefc0f59e888cf585f6eb253a60/lib/linguist/heuristics.rb#L145-L151) for `Scala`:\r\n\r\n```ruby\r\ndisambiguate \"Scala\", \"SuperCollider\" do |data|\r\n  if /\\^(this|super)\\./.match(data) || /^\\s*(\\+|\\*)\\s*\\w+\\s*{/.match(data) || /^\\s*~\\w+\\s*=\\./.match(data)\r\n    Language[\"SuperCollider\"]\r\n  elsif /^\\s*import (scala|java)\\./.match(data) || /^\\s*val\\s+\\w+\\s*=/.match(data) || /^\\s*class\\b/.match(data)\r\n    Language[\"Scala\"]\r\n  end\r\nend\r\n```","created_at":"2015-02-06T17:10:04Z","updated_at":"2015-02-06T17:10:04Z","html_url":"https://github.com/github/linguist/pull/2082#discussion_r24255160","pull_request_url":"https://api.github.com/repos/github/linguist/pulls/2082","_links":{"self":{"href":"https://api.github.com/repos/github/linguist/pulls/comments/24255160"},"html":{"href":"https://github.com/github/linguist/pull/2082#discussion_r24255160"},"pull_request":{"href":"https://api.github.com/repos/github/linguist/pulls/2082"}}},"pull_request":{"url":"https://api.github.com/repos/github/linguist/pulls/2082","id":28809301,"html_url":"https://github.com/github/linguist/pull/2082","diff_url":"https://github.com/github/linguist/pull/2082.diff","patch_url":"https://github.com/github/linguist/pull/2082.patch","issue_url":"https://api.github.com/repos/github/linguist/issues/2082","number":2082,"state":"open","locked":false,"title":"update to support PL/SQL PLpgSQL and SQLPL","user":{"login":"Shoelace","id":391364,"avatar_url":"https://avatars.githubusercontent.com/u/391364?v=3","gravatar_id":"","url":"https://api.github.com/users/Shoelace","html_url":"https://github.com/Shoelace","followers_url":"https://api.github.com/users/Shoelace/followers","following_url":"https://api.github.com/users/Shoelace/following{/other_user}","gists_url":"https://api.github.com/users/Shoelace/gists{/gist_id}","starred_url":"https://api.github.com/users/Shoelace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shoelace/subscriptions","organizations_url":"https://api.github.com/users/Shoelace/orgs","repos_url":"https://api.github.com/users/Shoelace/repos","events_url":"https://api.github.com/users/Shoelace/events{/privacy}","received_events_url":"https://api.github.com/users/Shoelace/received_events","type":"User","site_admin":false},"body":"update of old PL/SQL PLpgSQL and SQLPL patch based on current version\r\nsee add support for oracle PLSQL (#1003)\r\n\r\nI have tested this on my own repo. plus a number of publicly available ones..\r\nangoca/log4db2\r\nokbob/plpgsql_lint\r\nantzucaro/xonstatdb\r\n\r\nand it is correct as far as i can tell..  would appreciate some other people to check it..\r\nwe may need to add more/better samples.\r\n\r\nI think i have everything right with the new style now..\r\n\r\nFYI @chezwicker @pchaigno and @arfon \r\n\r\n","created_at":"2015-02-06T13:46:49Z","updated_at":"2015-02-06T17:10:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07361229601bd43de1f955578f53d43fe267ad13","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/github/linguist/pulls/2082/commits","review_comments_url":"https://api.github.com/repos/github/linguist/pulls/2082/comments","review_comment_url":"https://api.github.com/repos/github/linguist/pulls/comments/{number}","comments_url":"https://api.github.com/repos/github/linguist/issues/2082/comments","statuses_url":"https://api.github.com/repos/github/linguist/statuses/3e54d6651caab999f8827c46d60889c27f02af93","head":{"label":"Shoelace:plsql","ref":"plsql","sha":"3e54d6651caab999f8827c46d60889c27f02af93","user":{"login":"Shoelace","id":391364,"avatar_url":"https://avatars.githubusercontent.com/u/391364?v=3","gravatar_id":"","url":"https://api.github.com/users/Shoelace","html_url":"https://github.com/Shoelace","followers_url":"https://api.github.com/users/Shoelace/followers","following_url":"https://api.github.com/users/Shoelace/following{/other_user}","gists_url":"https://api.github.com/users/Shoelace/gists{/gist_id}","starred_url":"https://api.github.com/users/Shoelace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shoelace/subscriptions","organizations_url":"https://api.github.com/users/Shoelace/orgs","repos_url":"https://api.github.com/users/Shoelace/repos","events_url":"https://api.github.com/users/Shoelace/events{/privacy}","received_events_url":"https://api.github.com/users/Shoelace/received_events","type":"User","site_admin":false},"repo":{"id":30413209,"name":"linguist","full_name":"Shoelace/linguist","owner":{"login":"Shoelace","id":391364,"avatar_url":"https://avatars.githubusercontent.com/u/391364?v=3","gravatar_id":"","url":"https://api.github.com/users/Shoelace","html_url":"https://github.com/Shoelace","followers_url":"https://api.github.com/users/Shoelace/followers","following_url":"https://api.github.com/users/Shoelace/following{/other_user}","gists_url":"https://api.github.com/users/Shoelace/gists{/gist_id}","starred_url":"https://api.github.com/users/Shoelace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shoelace/subscriptions","organizations_url":"https://api.github.com/users/Shoelace/orgs","repos_url":"https://api.github.com/users/Shoelace/repos","events_url":"https://api.github.com/users/Shoelace/events{/privacy}","received_events_url":"https://api.github.com/users/Shoelace/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shoelace/linguist","description":"Language Savant. If your repository's language is being reported incorrectly, send us a pull request!","fork":true,"url":"https://api.github.com/repos/Shoelace/linguist","forks_url":"https://api.github.com/repos/Shoelace/linguist/forks","keys_url":"https://api.github.com/repos/Shoelace/linguist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shoelace/linguist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shoelace/linguist/teams","hooks_url":"https://api.github.com/repos/Shoelace/linguist/hooks","issue_events_url":"https://api.github.com/repos/Shoelace/linguist/issues/events{/number}","events_url":"https://api.github.com/repos/Shoelace/linguist/events","assignees_url":"https://api.github.com/repos/Shoelace/linguist/assignees{/user}","branches_url":"https://api.github.com/repos/Shoelace/linguist/branches{/branch}","tags_url":"https://api.github.com/repos/Shoelace/linguist/tags","blobs_url":"https://api.github.com/repos/Shoelace/linguist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shoelace/linguist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shoelace/linguist/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shoelace/linguist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shoelace/linguist/statuses/{sha}","languages_url":"https://api.github.com/repos/Shoelace/linguist/languages","stargazers_url":"https://api.github.com/repos/Shoelace/linguist/stargazers","contributors_url":"https://api.github.com/repos/Shoelace/linguist/contributors","subscribers_url":"https://api.github.com/repos/Shoelace/linguist/subscribers","subscription_url":"https://api.github.com/repos/Shoelace/linguist/subscription","commits_url":"https://api.github.com/repos/Shoelace/linguist/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shoelace/linguist/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shoelace/linguist/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shoelace/linguist/issues/comments/{number}","contents_url":"https://api.github.com/repos/Shoelace/linguist/contents/{+path}","compare_url":"https://api.github.com/repos/Shoelace/linguist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shoelace/linguist/merges","archive_url":"https://api.github.com/repos/Shoelace/linguist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shoelace/linguist/downloads","issues_url":"https://api.github.com/repos/Shoelace/linguist/issues{/number}","pulls_url":"https://api.github.com/repos/Shoelace/linguist/pulls{/number}","milestones_url":"https://api.github.com/repos/Shoelace/linguist/milestones{/number}","notifications_url":"https://api.github.com/repos/Shoelace/linguist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shoelace/linguist/labels{/name}","releases_url":"https://api.github.com/repos/Shoelace/linguist/releases{/id}","created_at":"2015-02-06T13:24:09Z","updated_at":"2015-02-06T13:24:11Z","pushed_at":"2015-02-06T13:38:32Z","git_url":"git://github.com/Shoelace/linguist.git","ssh_url":"git@github.com:Shoelace/linguist.git","clone_url":"https://github.com/Shoelace/linguist.git","svn_url":"https://github.com/Shoelace/linguist","homepage":"","size":45937,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"github:master","ref":"master","sha":"6d770ab68f7aa9b4ea8a31c260b20cf962971daf","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":1725199,"name":"linguist","full_name":"github/linguist","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/linguist","description":"Language Savant. If your repository's language is being reported incorrectly, send us a pull request!","fork":false,"url":"https://api.github.com/repos/github/linguist","forks_url":"https://api.github.com/repos/github/linguist/forks","keys_url":"https://api.github.com/repos/github/linguist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/linguist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/linguist/teams","hooks_url":"https://api.github.com/repos/github/linguist/hooks","issue_events_url":"https://api.github.com/repos/github/linguist/issues/events{/number}","events_url":"https://api.github.com/repos/github/linguist/events","assignees_url":"https://api.github.com/repos/github/linguist/assignees{/user}","branches_url":"https://api.github.com/repos/github/linguist/branches{/branch}","tags_url":"https://api.github.com/repos/github/linguist/tags","blobs_url":"https://api.github.com/repos/github/linguist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/linguist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/linguist/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/linguist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/linguist/statuses/{sha}","languages_url":"https://api.github.com/repos/github/linguist/languages","stargazers_url":"https://api.github.com/repos/github/linguist/stargazers","contributors_url":"https://api.github.com/repos/github/linguist/contributors","subscribers_url":"https://api.github.com/repos/github/linguist/subscribers","subscription_url":"https://api.github.com/repos/github/linguist/subscription","commits_url":"https://api.github.com/repos/github/linguist/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/linguist/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/linguist/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/linguist/issues/comments/{number}","contents_url":"https://api.github.com/repos/github/linguist/contents/{+path}","compare_url":"https://api.github.com/repos/github/linguist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/linguist/merges","archive_url":"https://api.github.com/repos/github/linguist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/linguist/downloads","issues_url":"https://api.github.com/repos/github/linguist/issues{/number}","pulls_url":"https://api.github.com/repos/github/linguist/pulls{/number}","milestones_url":"https://api.github.com/repos/github/linguist/milestones{/number}","notifications_url":"https://api.github.com/repos/github/linguist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/linguist/labels{/name}","releases_url":"https://api.github.com/repos/github/linguist/releases{/id}","created_at":"2011-05-09T22:53:13Z","updated_at":"2015-02-06T15:06:30Z","pushed_at":"2015-02-06T15:06:30Z","git_url":"git://github.com/github/linguist.git","ssh_url":"git@github.com:github/linguist.git","clone_url":"https://github.com/github/linguist.git","svn_url":"https://github.com/github/linguist","homepage":"","size":45937,"stargazers_count":2641,"watchers_count":2641,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1100,"mirror_url":null,"open_issues_count":75,"forks":1100,"open_issues":75,"watchers":2641,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/github/linguist/pulls/2082"},"html":{"href":"https://github.com/github/linguist/pull/2082"},"issue":{"href":"https://api.github.com/repos/github/linguist/issues/2082"},"comments":{"href":"https://api.github.com/repos/github/linguist/issues/2082/comments"},"review_comments":{"href":"https://api.github.com/repos/github/linguist/pulls/2082/comments"},"review_comment":{"href":"https://api.github.com/repos/github/linguist/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/github/linguist/pulls/2082/commits"},"statuses":{"href":"https://api.github.com/repos/github/linguist/statuses/3e54d6651caab999f8827c46d60889c27f02af93"}}}}