{"action":"created","comment":{"url":"https://api.github.com/repos/coala/coala-bears/pulls/comments/106807536","pull_request_review_id":27748735,"id":106807536,"diff_hunk":"@@ -0,0 +1,32 @@\n+import filecmp\n+import itertools\n+\n+from coalib.bears.GlobalBear import GlobalBear\n+from coalib.results.Result import Result\n+\n+\n+class DuplicateFileBear(GlobalBear):\n+    LANGUAGES = {'All'}\n+    AUTHORS = {'The coala developers'}\n+    AUTHORS_EMAILS = {'coala-devel@googlegroups.com'}\n+    LICENSE = 'AGPL-3.0'\n+    CAN_DETECT = {'Duplication'}\n+\n+    def run(self):\n+        \"\"\"\n+        Checks for Duplicate Files using filecmp module\n+        of Standard Library\n+        \"\"\"\n+        if not self.file_dict:\n+            yield Result(self, 'You did not add any file to compare')\n+        else:\n+            unique_tuples = [fileTuple for fileTuple in\n+                             itertools.combinations(self.file_dict, 2)]\n+\n+            for file_pair in unique_tuples:\n+                if filecmp.cmp(file_pair[0], file_pair[1]):","path":"bears/general/DuplicateFileBear.py","position":27,"original_position":27,"commit_id":"2fd25a6ce0c72d25d184220b4c4622c1cf3416e6","original_commit_id":"2fd25a6ce0c72d25d184220b4c4622c1cf3416e6","user":{"login":"meetmangukiya","id":7620533,"avatar_url":"https://avatars3.githubusercontent.com/u/7620533?v=3","gravatar_id":"","url":"https://api.github.com/users/meetmangukiya","html_url":"https://github.com/meetmangukiya","followers_url":"https://api.github.com/users/meetmangukiya/followers","following_url":"https://api.github.com/users/meetmangukiya/following{/other_user}","gists_url":"https://api.github.com/users/meetmangukiya/gists{/gist_id}","starred_url":"https://api.github.com/users/meetmangukiya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meetmangukiya/subscriptions","organizations_url":"https://api.github.com/users/meetmangukiya/orgs","repos_url":"https://api.github.com/users/meetmangukiya/repos","events_url":"https://api.github.com/users/meetmangukiya/events{/privacy}","received_events_url":"https://api.github.com/users/meetmangukiya/received_events","type":"User","site_admin":false},"body":"I think we can improve in performance here. The files are already loaded by `coala`. use something like `file_dict[file_pair[0]] == file_dict[file_pair[1]]`. ? We are providing file names here, I guess python loads the files again and then compares(not sure though). ","created_at":"2017-03-19T14:13:28Z","updated_at":"2017-03-19T14:15:28Z","html_url":"https://github.com/coala/coala-bears/pull/1514#discussion_r106807536","pull_request_url":"https://api.github.com/repos/coala/coala-bears/pulls/1514","_links":{"self":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/comments/106807536"},"html":{"href":"https://github.com/coala/coala-bears/pull/1514#discussion_r106807536"},"pull_request":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/1514"}}},"pull_request":{"url":"https://api.github.com/repos/coala/coala-bears/pulls/1514","id":110720327,"html_url":"https://github.com/coala/coala-bears/pull/1514","diff_url":"https://github.com/coala/coala-bears/pull/1514.diff","patch_url":"https://github.com/coala/coala-bears/pull/1514.patch","issue_url":"https://api.github.com/repos/coala/coala-bears/issues/1514","number":1514,"state":"open","locked":false,"title":"DuplicateFileBear: Add DuplicateFileBear","user":{"login":"Siddhartha1234","id":18551427,"avatar_url":"https://avatars0.githubusercontent.com/u/18551427?v=3","gravatar_id":"","url":"https://api.github.com/users/Siddhartha1234","html_url":"https://github.com/Siddhartha1234","followers_url":"https://api.github.com/users/Siddhartha1234/followers","following_url":"https://api.github.com/users/Siddhartha1234/following{/other_user}","gists_url":"https://api.github.com/users/Siddhartha1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Siddhartha1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siddhartha1234/subscriptions","organizations_url":"https://api.github.com/users/Siddhartha1234/orgs","repos_url":"https://api.github.com/users/Siddhartha1234/repos","events_url":"https://api.github.com/users/Siddhartha1234/events{/privacy}","received_events_url":"https://api.github.com/users/Siddhartha1234/received_events","type":"User","site_admin":false},"body":"This bear checks for files with same content .\r\n\r\nCloses https://github.com/coala/coala-bears/issues/1479\r\n\r\n<!--\r\nThanks for your contribution!\r\n\r\nPlease take a quick look at those things down there. They're quite important.\r\nReally! We wrote them for you. Yes you! With utmost care. Read them.\r\n-->\r\n\r\n**For short term contributors:** we understand that getting your commits well\r\ndefined like we require is a hard task and takes some learning. If you\r\nlook to help without wanting to contribute long term there's no need\r\nfor you to learn this. Just drop us a message and we'll take care of brushing\r\nup your stuff for merge!\r\n\r\n### Checklist\r\n\r\n- [ ] I read the [commit guidelines](http://coala.io/commit) and I've followed\r\n      them.\r\n- [ ] I ran coala over my code locally. (*All commits have to pass\r\n      individually.* It is not sufficient to have \"fixup commits\" on your PR,\r\n      our bot will still report the issues for the previous commit.) You will\r\n      likely receive a lot of bot comments and build failures if coala does not\r\n      pass on every single commit!\r\n\r\nAfter you submit your pull request, **DO NOT click the 'Update Branch' button.**\r\nWhen asked for a rebase, consult [coala.io/rebase](https://coala.io/rebase)\r\ninstead.\r\n\r\nPlease consider helping us by reviewing other peoples pull requests as well:\r\n\r\n- pick up any PR at <https://coala.io/review>\r\n- review it (check <https://coala.io/reviewing> for more info)\r\n- if you are sure that it needs work, use `cobot mark wip <URL>` to get it out\r\n  of the review queue.\r\n\r\nThe more you review, the more your score will grow at coala.io and we will\r\nreview your PRs faster!\r\n","created_at":"2017-03-14T21:21:42Z","updated_at":"2017-03-19T14:15:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39d9b017bbb8ee97f9671d40489f78c8d9796b91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coala/coala-bears/pulls/1514/commits","review_comments_url":"https://api.github.com/repos/coala/coala-bears/pulls/1514/comments","review_comment_url":"https://api.github.com/repos/coala/coala-bears/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coala/coala-bears/issues/1514/comments","statuses_url":"https://api.github.com/repos/coala/coala-bears/statuses/2fd25a6ce0c72d25d184220b4c4622c1cf3416e6","head":{"label":"Siddhartha1234:Siddhartha1234/DuplicateFileBear","ref":"Siddhartha1234/DuplicateFileBear","sha":"2fd25a6ce0c72d25d184220b4c4622c1cf3416e6","user":{"login":"Siddhartha1234","id":18551427,"avatar_url":"https://avatars0.githubusercontent.com/u/18551427?v=3","gravatar_id":"","url":"https://api.github.com/users/Siddhartha1234","html_url":"https://github.com/Siddhartha1234","followers_url":"https://api.github.com/users/Siddhartha1234/followers","following_url":"https://api.github.com/users/Siddhartha1234/following{/other_user}","gists_url":"https://api.github.com/users/Siddhartha1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Siddhartha1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siddhartha1234/subscriptions","organizations_url":"https://api.github.com/users/Siddhartha1234/orgs","repos_url":"https://api.github.com/users/Siddhartha1234/repos","events_url":"https://api.github.com/users/Siddhartha1234/events{/privacy}","received_events_url":"https://api.github.com/users/Siddhartha1234/received_events","type":"User","site_admin":false},"repo":{"id":84045066,"name":"coala-bears","full_name":"Siddhartha1234/coala-bears","owner":{"login":"Siddhartha1234","id":18551427,"avatar_url":"https://avatars0.githubusercontent.com/u/18551427?v=3","gravatar_id":"","url":"https://api.github.com/users/Siddhartha1234","html_url":"https://github.com/Siddhartha1234","followers_url":"https://api.github.com/users/Siddhartha1234/followers","following_url":"https://api.github.com/users/Siddhartha1234/following{/other_user}","gists_url":"https://api.github.com/users/Siddhartha1234/gists{/gist_id}","starred_url":"https://api.github.com/users/Siddhartha1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siddhartha1234/subscriptions","organizations_url":"https://api.github.com/users/Siddhartha1234/orgs","repos_url":"https://api.github.com/users/Siddhartha1234/repos","events_url":"https://api.github.com/users/Siddhartha1234/events{/privacy}","received_events_url":"https://api.github.com/users/Siddhartha1234/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Siddhartha1234/coala-bears","description":"Bears for coala","fork":true,"url":"https://api.github.com/repos/Siddhartha1234/coala-bears","forks_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/forks","keys_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/teams","hooks_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/hooks","issue_events_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/issues/events{/number}","events_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/events","assignees_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/assignees{/user}","branches_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/branches{/branch}","tags_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/tags","blobs_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/git/refs{/sha}","trees_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/statuses/{sha}","languages_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/languages","stargazers_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/stargazers","contributors_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/contributors","subscribers_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/subscribers","subscription_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/subscription","commits_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/commits{/sha}","git_commits_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/git/commits{/sha}","comments_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/comments{/number}","issue_comment_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/issues/comments{/number}","contents_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/contents/{+path}","compare_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/merges","archive_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/downloads","issues_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/issues{/number}","pulls_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/pulls{/number}","milestones_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/milestones{/number}","notifications_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/labels{/name}","releases_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/releases{/id}","deployments_url":"https://api.github.com/repos/Siddhartha1234/coala-bears/deployments","created_at":"2017-03-06T07:51:40Z","updated_at":"2017-03-06T07:51:42Z","pushed_at":"2017-03-15T16:19:11Z","git_url":"git://github.com/Siddhartha1234/coala-bears.git","ssh_url":"git@github.com:Siddhartha1234/coala-bears.git","clone_url":"https://github.com/Siddhartha1234/coala-bears.git","svn_url":"https://github.com/Siddhartha1234/coala-bears","homepage":"https://coala.io/","size":1529,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"coala:master","ref":"master","sha":"f04f8bcfe0c8eb4918c7a082105d8ea8b6e87ce6","user":{"login":"coala","id":10620750,"avatar_url":"https://avatars0.githubusercontent.com/u/10620750?v=3","gravatar_id":"","url":"https://api.github.com/users/coala","html_url":"https://github.com/coala","followers_url":"https://api.github.com/users/coala/followers","following_url":"https://api.github.com/users/coala/following{/other_user}","gists_url":"https://api.github.com/users/coala/gists{/gist_id}","starred_url":"https://api.github.com/users/coala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coala/subscriptions","organizations_url":"https://api.github.com/users/coala/orgs","repos_url":"https://api.github.com/users/coala/repos","events_url":"https://api.github.com/users/coala/events{/privacy}","received_events_url":"https://api.github.com/users/coala/received_events","type":"Organization","site_admin":false},"repo":{"id":51688289,"name":"coala-bears","full_name":"coala/coala-bears","owner":{"login":"coala","id":10620750,"avatar_url":"https://avatars0.githubusercontent.com/u/10620750?v=3","gravatar_id":"","url":"https://api.github.com/users/coala","html_url":"https://github.com/coala","followers_url":"https://api.github.com/users/coala/followers","following_url":"https://api.github.com/users/coala/following{/other_user}","gists_url":"https://api.github.com/users/coala/gists{/gist_id}","starred_url":"https://api.github.com/users/coala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coala/subscriptions","organizations_url":"https://api.github.com/users/coala/orgs","repos_url":"https://api.github.com/users/coala/repos","events_url":"https://api.github.com/users/coala/events{/privacy}","received_events_url":"https://api.github.com/users/coala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coala/coala-bears","description":"Bears for coala","fork":false,"url":"https://api.github.com/repos/coala/coala-bears","forks_url":"https://api.github.com/repos/coala/coala-bears/forks","keys_url":"https://api.github.com/repos/coala/coala-bears/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coala/coala-bears/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coala/coala-bears/teams","hooks_url":"https://api.github.com/repos/coala/coala-bears/hooks","issue_events_url":"https://api.github.com/repos/coala/coala-bears/issues/events{/number}","events_url":"https://api.github.com/repos/coala/coala-bears/events","assignees_url":"https://api.github.com/repos/coala/coala-bears/assignees{/user}","branches_url":"https://api.github.com/repos/coala/coala-bears/branches{/branch}","tags_url":"https://api.github.com/repos/coala/coala-bears/tags","blobs_url":"https://api.github.com/repos/coala/coala-bears/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coala/coala-bears/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coala/coala-bears/git/refs{/sha}","trees_url":"https://api.github.com/repos/coala/coala-bears/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coala/coala-bears/statuses/{sha}","languages_url":"https://api.github.com/repos/coala/coala-bears/languages","stargazers_url":"https://api.github.com/repos/coala/coala-bears/stargazers","contributors_url":"https://api.github.com/repos/coala/coala-bears/contributors","subscribers_url":"https://api.github.com/repos/coala/coala-bears/subscribers","subscription_url":"https://api.github.com/repos/coala/coala-bears/subscription","commits_url":"https://api.github.com/repos/coala/coala-bears/commits{/sha}","git_commits_url":"https://api.github.com/repos/coala/coala-bears/git/commits{/sha}","comments_url":"https://api.github.com/repos/coala/coala-bears/comments{/number}","issue_comment_url":"https://api.github.com/repos/coala/coala-bears/issues/comments{/number}","contents_url":"https://api.github.com/repos/coala/coala-bears/contents/{+path}","compare_url":"https://api.github.com/repos/coala/coala-bears/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coala/coala-bears/merges","archive_url":"https://api.github.com/repos/coala/coala-bears/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coala/coala-bears/downloads","issues_url":"https://api.github.com/repos/coala/coala-bears/issues{/number}","pulls_url":"https://api.github.com/repos/coala/coala-bears/pulls{/number}","milestones_url":"https://api.github.com/repos/coala/coala-bears/milestones{/number}","notifications_url":"https://api.github.com/repos/coala/coala-bears/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coala/coala-bears/labels{/name}","releases_url":"https://api.github.com/repos/coala/coala-bears/releases{/id}","deployments_url":"https://api.github.com/repos/coala/coala-bears/deployments","created_at":"2016-02-14T09:25:11Z","updated_at":"2017-03-18T20:18:14Z","pushed_at":"2017-03-17T21:33:19Z","git_url":"git://github.com/coala/coala-bears.git","ssh_url":"git@github.com:coala/coala-bears.git","clone_url":"https://github.com/coala/coala-bears.git","svn_url":"https://github.com/coala/coala-bears","homepage":"https://coala.io/","size":1531,"stargazers_count":98,"watchers_count":98,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":255,"mirror_url":null,"open_issues_count":376,"forks":255,"open_issues":376,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/1514"},"html":{"href":"https://github.com/coala/coala-bears/pull/1514"},"issue":{"href":"https://api.github.com/repos/coala/coala-bears/issues/1514"},"comments":{"href":"https://api.github.com/repos/coala/coala-bears/issues/1514/comments"},"review_comments":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/1514/comments"},"review_comment":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coala/coala-bears/pulls/1514/commits"},"statuses":{"href":"https://api.github.com/repos/coala/coala-bears/statuses/2fd25a6ce0c72d25d184220b4c4622c1cf3416e6"}}}}
{"actor":{"display_login":"meetmangukiya"}}