{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/62932390","id":62932390,"diff_hunk":"@@ -0,0 +1,74 @@\n+# coding: utf-8\n+#\n+# Copyright 2014 The Oppia Authors. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS-IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+# Pre-submission script for Oppia.\n+# This script checks for unaccepted text patterns in the commit.\n+\n+import os\n+import fnmatch\n+import subprocess\n+\n+pattern = [\"__author__\",\"datetime.datetime.now()\"]\n+_PARENT_DIR = os.path.abspath(os.path.join(os.getcwd(), os.pardir))\n+\n+total_files_checked = 0\n+total_error_count = 0\n+\n+def _get_changed_filenames():\n+    \"\"\"Returns a list of modified files (both staged and unstaged)\n+\n+    Returns:\n+        a list of filenames of modified files\n+    \"\"\"\n+    unstaged_files = subprocess.check_output([\n+        'git', 'diff', '--name-only']).splitlines()\n+    staged_files = subprocess.check_output([\n+        'git', 'diff', '--cached', '--name-only',\n+        '--diff-filter=ACM']).splitlines()\n+    return unstaged_files + staged_files\n+\n+def pre_submission_check(dir):\n+    global total_files_checked\n+    global total_error_count\n+    files = _get_changed_filenames()\n+    if len(files)!=0:","path":"scripts/run_pattern_check.py","position":47,"original_position":47,"commit_id":"179432271ac99bfbe194aa138b4616a97899e0a4","original_commit_id":"179432271ac99bfbe194aa138b4616a97899e0a4","user":{"login":"souravbadami","id":11073943,"avatar_url":"https://avatars.githubusercontent.com/u/11073943?v=3","gravatar_id":"","url":"https://api.github.com/users/souravbadami","html_url":"https://github.com/souravbadami","followers_url":"https://api.github.com/users/souravbadami/followers","following_url":"https://api.github.com/users/souravbadami/following{/other_user}","gists_url":"https://api.github.com/users/souravbadami/gists{/gist_id}","starred_url":"https://api.github.com/users/souravbadami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souravbadami/subscriptions","organizations_url":"https://api.github.com/users/souravbadami/orgs","repos_url":"https://api.github.com/users/souravbadami/repos","events_url":"https://api.github.com/users/souravbadami/events{/privacy}","received_events_url":"https://api.github.com/users/souravbadami/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-05-11T21:43:55Z","updated_at":"2016-05-11T21:43:55Z","html_url":"https://github.com/oppia/oppia/pull/1823#discussion_r62932390","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/1823","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/62932390"},"html":{"href":"https://github.com/oppia/oppia/pull/1823#discussion_r62932390"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1823"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/1823","id":69744584,"html_url":"https://github.com/oppia/oppia/pull/1823","diff_url":"https://github.com/oppia/oppia/pull/1823.diff","patch_url":"https://github.com/oppia/oppia/pull/1823.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/1823","number":1823,"state":"open","locked":false,"title":"Fix #1540: Added tests for detecting bad patterns.","user":{"login":"souravbadami","id":11073943,"avatar_url":"https://avatars.githubusercontent.com/u/11073943?v=3","gravatar_id":"","url":"https://api.github.com/users/souravbadami","html_url":"https://github.com/souravbadami","followers_url":"https://api.github.com/users/souravbadami/followers","following_url":"https://api.github.com/users/souravbadami/following{/other_user}","gists_url":"https://api.github.com/users/souravbadami/gists{/gist_id}","starred_url":"https://api.github.com/users/souravbadami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souravbadami/subscriptions","organizations_url":"https://api.github.com/users/souravbadami/orgs","repos_url":"https://api.github.com/users/souravbadami/repos","events_url":"https://api.github.com/users/souravbadami/events{/privacy}","received_events_url":"https://api.github.com/users/souravbadami/received_events","type":"User","site_admin":false},"body":"Added run_pattern_check.py script to detect bad patterns in commits.\r\nUpdated .travis.yml to add new test for checking patterns. #1540","created_at":"2016-05-11T21:21:38Z","updated_at":"2016-05-11T21:43:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6398a89c9e8f672416637036482e9ce84f90a13f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/1823/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/1823/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/1823/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/179432271ac99bfbe194aa138b4616a97899e0a4","head":{"label":"souravbadami:fix_1540","ref":"fix_1540","sha":"179432271ac99bfbe194aa138b4616a97899e0a4","user":{"login":"souravbadami","id":11073943,"avatar_url":"https://avatars.githubusercontent.com/u/11073943?v=3","gravatar_id":"","url":"https://api.github.com/users/souravbadami","html_url":"https://github.com/souravbadami","followers_url":"https://api.github.com/users/souravbadami/followers","following_url":"https://api.github.com/users/souravbadami/following{/other_user}","gists_url":"https://api.github.com/users/souravbadami/gists{/gist_id}","starred_url":"https://api.github.com/users/souravbadami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souravbadami/subscriptions","organizations_url":"https://api.github.com/users/souravbadami/orgs","repos_url":"https://api.github.com/users/souravbadami/repos","events_url":"https://api.github.com/users/souravbadami/events{/privacy}","received_events_url":"https://api.github.com/users/souravbadami/received_events","type":"User","site_admin":false},"repo":{"id":54706793,"name":"oppia","full_name":"souravbadami/oppia","owner":{"login":"souravbadami","id":11073943,"avatar_url":"https://avatars.githubusercontent.com/u/11073943?v=3","gravatar_id":"","url":"https://api.github.com/users/souravbadami","html_url":"https://github.com/souravbadami","followers_url":"https://api.github.com/users/souravbadami/followers","following_url":"https://api.github.com/users/souravbadami/following{/other_user}","gists_url":"https://api.github.com/users/souravbadami/gists{/gist_id}","starred_url":"https://api.github.com/users/souravbadami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/souravbadami/subscriptions","organizations_url":"https://api.github.com/users/souravbadami/orgs","repos_url":"https://api.github.com/users/souravbadami/repos","events_url":"https://api.github.com/users/souravbadami/events{/privacy}","received_events_url":"https://api.github.com/users/souravbadami/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/souravbadami/oppia","description":"Tool for collaboratively building intelligent tutors.","fork":true,"url":"https://api.github.com/repos/souravbadami/oppia","forks_url":"https://api.github.com/repos/souravbadami/oppia/forks","keys_url":"https://api.github.com/repos/souravbadami/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/souravbadami/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/souravbadami/oppia/teams","hooks_url":"https://api.github.com/repos/souravbadami/oppia/hooks","issue_events_url":"https://api.github.com/repos/souravbadami/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/souravbadami/oppia/events","assignees_url":"https://api.github.com/repos/souravbadami/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/souravbadami/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/souravbadami/oppia/tags","blobs_url":"https://api.github.com/repos/souravbadami/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/souravbadami/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/souravbadami/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/souravbadami/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/souravbadami/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/souravbadami/oppia/languages","stargazers_url":"https://api.github.com/repos/souravbadami/oppia/stargazers","contributors_url":"https://api.github.com/repos/souravbadami/oppia/contributors","subscribers_url":"https://api.github.com/repos/souravbadami/oppia/subscribers","subscription_url":"https://api.github.com/repos/souravbadami/oppia/subscription","commits_url":"https://api.github.com/repos/souravbadami/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/souravbadami/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/souravbadami/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/souravbadami/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/souravbadami/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/souravbadami/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/souravbadami/oppia/merges","archive_url":"https://api.github.com/repos/souravbadami/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/souravbadami/oppia/downloads","issues_url":"https://api.github.com/repos/souravbadami/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/souravbadami/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/souravbadami/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/souravbadami/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/souravbadami/oppia/labels{/name}","releases_url":"https://api.github.com/repos/souravbadami/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/souravbadami/oppia/deployments","created_at":"2016-03-25T08:49:23Z","updated_at":"2016-03-25T08:49:26Z","pushed_at":"2016-05-11T21:35:01Z","git_url":"git://github.com/souravbadami/oppia.git","ssh_url":"git@github.com:souravbadami/oppia.git","clone_url":"https://github.com/souravbadami/oppia.git","svn_url":"https://github.com/souravbadami/oppia","homepage":"https://www.oppia.org","size":43587,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"48cce4ca0ef7233175ced9c188bd7312335a0460","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building intelligent tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2016-05-07T23:43:28Z","pushed_at":"2016-05-11T21:35:01Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":76173,"stargazers_count":126,"watchers_count":126,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":215,"mirror_url":null,"open_issues_count":290,"forks":215,"open_issues":290,"watchers":126,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1823"},"html":{"href":"https://github.com/oppia/oppia/pull/1823"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/1823"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/1823/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1823/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1823/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/179432271ac99bfbe194aa138b4616a97899e0a4"}}}}