{"action":"created","comment":{"url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/comments/60792965","id":60792965,"diff_hunk":"@@ -0,0 +1,69 @@\n+require \"digest/md5\"\n+\n+module CC\n+  module CLI\n+    class SourceFingerprint\n+      def initialize(output)\n+        @output = output\n+      end\n+\n+      def compute\n+        md5 = Digest::MD5.new\n+        md5 << key\n+        md5.hexdigest\n+      end\n+\n+      def key\n+        key = \"#{path}|#{check_name}\"\n+        key << \"|#{source.gsub(/\\s+/, \"\")}\" if source\n+        key\n+      end\n+\n+      private\n+\n+      attr_reader :output\n+\n+      def check_name\n+        output[\"check_name\"]\n+      end\n+\n+      def path\n+        output.fetch(\"location\", {}).fetch(\"path\", \"\")\n+      end\n+\n+      def source\n+        @source ||= begin\n+          if line_range","path":"lib/cc/cli/source_fingerprint.rb","position":36,"original_position":36,"commit_id":"3abcc73f768f7360a6478b29df86403388471f11","original_commit_id":"3abcc73f768f7360a6478b29df86403388471f11","user":{"login":"dblandin","id":123595,"avatar_url":"https://avatars.githubusercontent.com/u/123595?v=3","gravatar_id":"","url":"https://api.github.com/users/dblandin","html_url":"https://github.com/dblandin","followers_url":"https://api.github.com/users/dblandin/followers","following_url":"https://api.github.com/users/dblandin/following{/other_user}","gists_url":"https://api.github.com/users/dblandin/gists{/gist_id}","starred_url":"https://api.github.com/users/dblandin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblandin/subscriptions","organizations_url":"https://api.github.com/users/dblandin/orgs","repos_url":"https://api.github.com/users/dblandin/repos","events_url":"https://api.github.com/users/dblandin/events{/privacy}","received_events_url":"https://api.github.com/users/dblandin/received_events","type":"User","site_admin":false},"body":"Nope, I can bake in position support as well.","created_at":"2016-04-22T19:43:23Z","updated_at":"2016-04-22T19:43:23Z","html_url":"https://github.com/codeclimate/codeclimate/pull/419#discussion_r60792965","pull_request_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419","_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/comments/60792965"},"html":{"href":"https://github.com/codeclimate/codeclimate/pull/419#discussion_r60792965"},"pull_request":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419"}}},"pull_request":{"url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419","id":67560630,"html_url":"https://github.com/codeclimate/codeclimate/pull/419","diff_url":"https://github.com/codeclimate/codeclimate/pull/419.diff","patch_url":"https://github.com/codeclimate/codeclimate/pull/419.patch","issue_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/419","number":419,"state":"open","locked":false,"title":"Add SourceFingerprint based on path, check_name, and source","user":{"login":"dblandin","id":123595,"avatar_url":"https://avatars.githubusercontent.com/u/123595?v=3","gravatar_id":"","url":"https://api.github.com/users/dblandin","html_url":"https://github.com/dblandin","followers_url":"https://api.github.com/users/dblandin/followers","following_url":"https://api.github.com/users/dblandin/following{/other_user}","gists_url":"https://api.github.com/users/dblandin/gists{/gist_id}","starred_url":"https://api.github.com/users/dblandin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblandin/subscriptions","organizations_url":"https://api.github.com/users/dblandin/orgs","repos_url":"https://api.github.com/users/dblandin/repos","events_url":"https://api.github.com/users/dblandin/events{/privacy}","received_events_url":"https://api.github.com/users/dblandin/received_events","type":"User","site_admin":false},"body":"Currently, the default fingerprint for an issue is computed by creating an MD5 digest based on the path of the file which introduced the issue and the check name for the issue emitted.\r\n\r\nThe result of this fingerprint for many engines is that issues emitted with the same check name for the same file are given the same fingerprint. On codeclimate.com, we only show issues with unique fingerprints, so even if 100 issues were emitted for a file, if all issues share the same check name and thus the same fingerprint, we only show one issue.\r\n\r\nAdditionally, a fixed or introduced issue is often ignored if there are current issues with the same fingerprint already on the default branch.\r\n\r\nThis PR introduces new fingerprinting behavior to address these issues, first added to a [couple][markdownlint] [engines][shellcheck], that incorporates relevant source code into the fingerprint. This implementation allows us to enable the new fingerprinting behavior with an environment variable so we can roll it out gradually. Eventually, this will become the new default fingerprinting method for engines.\r\n\r\n@codeclimate/review :mag_right:\r\n\r\n[markdownlint]: https://github.com/jpignata/codeclimate-markdownlint\r\n[shellcheck]: https://github.com/filib/codeclimate-shellcheck","created_at":"2016-04-22T19:26:22Z","updated_at":"2016-04-22T19:43:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"189d606b89fe03188f8d776d091cc91882ed34af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419/commits","review_comments_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419/comments","review_comment_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/419/comments","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate/statuses/3abcc73f768f7360a6478b29df86403388471f11","head":{"label":"codeclimate:devon/add-source-fingerprinting","ref":"devon/add-source-fingerprinting","sha":"3abcc73f768f7360a6478b29df86403388471f11","user":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"repo":{"id":37724576,"name":"codeclimate","full_name":"codeclimate/codeclimate","owner":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeclimate/codeclimate","description":"Code Climate CLI","fork":false,"url":"https://api.github.com/repos/codeclimate/codeclimate","forks_url":"https://api.github.com/repos/codeclimate/codeclimate/forks","keys_url":"https://api.github.com/repos/codeclimate/codeclimate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeclimate/codeclimate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeclimate/codeclimate/teams","hooks_url":"https://api.github.com/repos/codeclimate/codeclimate/hooks","issue_events_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/events{/number}","events_url":"https://api.github.com/repos/codeclimate/codeclimate/events","assignees_url":"https://api.github.com/repos/codeclimate/codeclimate/assignees{/user}","branches_url":"https://api.github.com/repos/codeclimate/codeclimate/branches{/branch}","tags_url":"https://api.github.com/repos/codeclimate/codeclimate/tags","blobs_url":"https://api.github.com/repos/codeclimate/codeclimate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeclimate/codeclimate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeclimate/codeclimate/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeclimate/codeclimate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate/statuses/{sha}","languages_url":"https://api.github.com/repos/codeclimate/codeclimate/languages","stargazers_url":"https://api.github.com/repos/codeclimate/codeclimate/stargazers","contributors_url":"https://api.github.com/repos/codeclimate/codeclimate/contributors","subscribers_url":"https://api.github.com/repos/codeclimate/codeclimate/subscribers","subscription_url":"https://api.github.com/repos/codeclimate/codeclimate/subscription","commits_url":"https://api.github.com/repos/codeclimate/codeclimate/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeclimate/codeclimate/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeclimate/codeclimate/contents/{+path}","compare_url":"https://api.github.com/repos/codeclimate/codeclimate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeclimate/codeclimate/merges","archive_url":"https://api.github.com/repos/codeclimate/codeclimate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeclimate/codeclimate/downloads","issues_url":"https://api.github.com/repos/codeclimate/codeclimate/issues{/number}","pulls_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls{/number}","milestones_url":"https://api.github.com/repos/codeclimate/codeclimate/milestones{/number}","notifications_url":"https://api.github.com/repos/codeclimate/codeclimate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeclimate/codeclimate/labels{/name}","releases_url":"https://api.github.com/repos/codeclimate/codeclimate/releases{/id}","deployments_url":"https://api.github.com/repos/codeclimate/codeclimate/deployments","created_at":"2015-06-19T13:54:41Z","updated_at":"2016-04-22T16:04:57Z","pushed_at":"2016-04-22T19:28:31Z","git_url":"git://github.com/codeclimate/codeclimate.git","ssh_url":"git@github.com:codeclimate/codeclimate.git","clone_url":"https://github.com/codeclimate/codeclimate.git","svn_url":"https://github.com/codeclimate/codeclimate","homepage":"https://codeclimate.com/","size":1212,"stargazers_count":808,"watchers_count":808,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":11,"forks":76,"open_issues":11,"watchers":808,"default_branch":"master"}},"base":{"label":"codeclimate:master","ref":"master","sha":"12a76afdec516d87786154a89af53074afa14769","user":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"repo":{"id":37724576,"name":"codeclimate","full_name":"codeclimate/codeclimate","owner":{"login":"codeclimate","id":789641,"avatar_url":"https://avatars.githubusercontent.com/u/789641?v=3","gravatar_id":"","url":"https://api.github.com/users/codeclimate","html_url":"https://github.com/codeclimate","followers_url":"https://api.github.com/users/codeclimate/followers","following_url":"https://api.github.com/users/codeclimate/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate/subscriptions","organizations_url":"https://api.github.com/users/codeclimate/orgs","repos_url":"https://api.github.com/users/codeclimate/repos","events_url":"https://api.github.com/users/codeclimate/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeclimate/codeclimate","description":"Code Climate CLI","fork":false,"url":"https://api.github.com/repos/codeclimate/codeclimate","forks_url":"https://api.github.com/repos/codeclimate/codeclimate/forks","keys_url":"https://api.github.com/repos/codeclimate/codeclimate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeclimate/codeclimate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeclimate/codeclimate/teams","hooks_url":"https://api.github.com/repos/codeclimate/codeclimate/hooks","issue_events_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/events{/number}","events_url":"https://api.github.com/repos/codeclimate/codeclimate/events","assignees_url":"https://api.github.com/repos/codeclimate/codeclimate/assignees{/user}","branches_url":"https://api.github.com/repos/codeclimate/codeclimate/branches{/branch}","tags_url":"https://api.github.com/repos/codeclimate/codeclimate/tags","blobs_url":"https://api.github.com/repos/codeclimate/codeclimate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeclimate/codeclimate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeclimate/codeclimate/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeclimate/codeclimate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeclimate/codeclimate/statuses/{sha}","languages_url":"https://api.github.com/repos/codeclimate/codeclimate/languages","stargazers_url":"https://api.github.com/repos/codeclimate/codeclimate/stargazers","contributors_url":"https://api.github.com/repos/codeclimate/codeclimate/contributors","subscribers_url":"https://api.github.com/repos/codeclimate/codeclimate/subscribers","subscription_url":"https://api.github.com/repos/codeclimate/codeclimate/subscription","commits_url":"https://api.github.com/repos/codeclimate/codeclimate/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeclimate/codeclimate/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeclimate/codeclimate/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeclimate/codeclimate/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeclimate/codeclimate/contents/{+path}","compare_url":"https://api.github.com/repos/codeclimate/codeclimate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeclimate/codeclimate/merges","archive_url":"https://api.github.com/repos/codeclimate/codeclimate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeclimate/codeclimate/downloads","issues_url":"https://api.github.com/repos/codeclimate/codeclimate/issues{/number}","pulls_url":"https://api.github.com/repos/codeclimate/codeclimate/pulls{/number}","milestones_url":"https://api.github.com/repos/codeclimate/codeclimate/milestones{/number}","notifications_url":"https://api.github.com/repos/codeclimate/codeclimate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeclimate/codeclimate/labels{/name}","releases_url":"https://api.github.com/repos/codeclimate/codeclimate/releases{/id}","deployments_url":"https://api.github.com/repos/codeclimate/codeclimate/deployments","created_at":"2015-06-19T13:54:41Z","updated_at":"2016-04-22T16:04:57Z","pushed_at":"2016-04-22T19:28:31Z","git_url":"git://github.com/codeclimate/codeclimate.git","ssh_url":"git@github.com:codeclimate/codeclimate.git","clone_url":"https://github.com/codeclimate/codeclimate.git","svn_url":"https://github.com/codeclimate/codeclimate","homepage":"https://codeclimate.com/","size":1212,"stargazers_count":808,"watchers_count":808,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":11,"forks":76,"open_issues":11,"watchers":808,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419"},"html":{"href":"https://github.com/codeclimate/codeclimate/pull/419"},"issue":{"href":"https://api.github.com/repos/codeclimate/codeclimate/issues/419"},"comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate/issues/419/comments"},"review_comments":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419/comments"},"review_comment":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeclimate/codeclimate/pulls/419/commits"},"statuses":{"href":"https://api.github.com/repos/codeclimate/codeclimate/statuses/3abcc73f768f7360a6478b29df86403388471f11"}}}}