{"action":"created","comment":{"url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/comments/242726070","pull_request_review_id":186306288,"id":242726070,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjcyNjA3MA==","diff_hunk":"@@ -13,25 +13,57 @@\n from pynvim import attach\n \n \n-def my_print(string, f=None):\n+def log(string, f=None):\n+    \"\"\"Log to terminal and to file.\"\"\"\n     print(string)\n     if f is not None:\n         f.write(string + \"\\n\")\n \n \n def print_banner(string, f=None):\n-    my_print(\"\"\"\n+    \"\"\"Print a banner with the result of the test.\"\"\"\n+    log(\"\"\"\n ++--------------------------------------------------------------\n ++ %s\n ++--------------------------------------------------------------\"\"\" % string, f)\n \n+def vimrc_info(vimrc, type):\n+    \"\"\"Log the description if present inside the vimrc.\"\"\"\n+    with open(vimrc) as file:\n+        v = file.readline()\n+        if v[:14] == '\" DESCRIPTION:':\n+            return v[15:]\n+        else:\n+            return \"using \" + type + \" vimrc\"\n+\n+def get_vimrc(test, f):\n+    \"\"\"Check if test-specific vimrc is present, or use default one.\"\"\"\n+    try:\n+        vimrc = Path('tests/', test, 'vimrc.vim').resolve(strict=True)\n+        output = vimrc_info(vimrc, 'test')\n+    except FileNotFoundError:\n+        vimrc, output = VIMRC, INFO\n+    log(output, f)\n+    return vimrc\n+\n+def get_paths(test, f):\n+    \"\"\"Create the dictionary with the relevant file paths.\"\"\"\n+    paths = {}\n+    paths[\"vimrc\"] = get_vimrc(test, f)\n+    paths[\"command\"] = Path('tests/', test, 'commands.py').resolve(strict=True)\n+    paths[\"in_file\"] = Path('tests/', test, 'input_file.txt').resolve(strict=True)\n+    paths[\"exp_out_file\"] = Path('tests/', test, 'expected_output_file.txt').resolve(strict=True)\n+    paths[\"gen_out_file\"] = Path('tests/', test, 'generated_output_file.txt').resolve()\n+    paths[\"socket\"] = Path('socket_' + test).resolve()\n+    return paths","path":"vimrunner/test.py","position":54,"original_position":54,"commit_id":"ae64fabbd72f61ca37a6e1af431afe5b118eef96","original_commit_id":"ae64fabbd72f61ca37a6e1af431afe5b118eef96","user":{"login":"mg979","id":26169924,"node_id":"MDQ6VXNlcjI2MTY5OTI0","avatar_url":"https://avatars3.githubusercontent.com/u/26169924?v=4","gravatar_id":"","url":"https://api.github.com/users/mg979","html_url":"https://github.com/mg979","followers_url":"https://api.github.com/users/mg979/followers","following_url":"https://api.github.com/users/mg979/following{/other_user}","gists_url":"https://api.github.com/users/mg979/gists{/gist_id}","starred_url":"https://api.github.com/users/mg979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg979/subscriptions","organizations_url":"https://api.github.com/users/mg979/orgs","repos_url":"https://api.github.com/users/mg979/repos","events_url":"https://api.github.com/users/mg979/events{/privacy}","received_events_url":"https://api.github.com/users/mg979/received_events","type":"User","site_admin":false},"body":"Simple refactor","created_at":"2018-12-18T22:15:06Z","updated_at":"2018-12-18T22:16:14Z","html_url":"https://github.com/antoinemadec/vim-visual-multi/pull/1#discussion_r242726070","pull_request_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/comments/242726070"},"html":{"href":"https://github.com/antoinemadec/vim-visual-multi/pull/1#discussion_r242726070"},"pull_request":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1","id":239647969,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NjQ3OTY5","html_url":"https://github.com/antoinemadec/vim-visual-multi/pull/1","diff_url":"https://github.com/antoinemadec/vim-visual-multi/pull/1.diff","patch_url":"https://github.com/antoinemadec/vim-visual-multi/pull/1.patch","issue_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/1","number":1,"state":"open","locked":false,"title":"Updated test.py, renamed tests dir","user":{"login":"mg979","id":26169924,"node_id":"MDQ6VXNlcjI2MTY5OTI0","avatar_url":"https://avatars3.githubusercontent.com/u/26169924?v=4","gravatar_id":"","url":"https://api.github.com/users/mg979","html_url":"https://github.com/mg979","followers_url":"https://api.github.com/users/mg979/followers","following_url":"https://api.github.com/users/mg979/following{/other_user}","gists_url":"https://api.github.com/users/mg979/gists{/gist_id}","starred_url":"https://api.github.com/users/mg979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg979/subscriptions","organizations_url":"https://api.github.com/users/mg979/orgs","repos_url":"https://api.github.com/users/mg979/repos","events_url":"https://api.github.com/users/mg979/events{/privacy}","received_events_url":"https://api.github.com/users/mg979/received_events","type":"User","site_admin":false},"body":"Added option to show a test/vimrc description\r\nAlso an option to use different default vimrc's using -v argument","created_at":"2018-12-18T22:07:42Z","updated_at":"2018-12-18T22:16:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85e39f46692064f6c8da769b33ae9b4d2e53fcc2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1/commits","review_comments_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1/comments","review_comment_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/1/comments","statuses_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/statuses/ae64fabbd72f61ca37a6e1af431afe5b118eef96","head":{"label":"mg979:vimrunner","ref":"vimrunner","sha":"ae64fabbd72f61ca37a6e1af431afe5b118eef96","user":{"login":"mg979","id":26169924,"node_id":"MDQ6VXNlcjI2MTY5OTI0","avatar_url":"https://avatars3.githubusercontent.com/u/26169924?v=4","gravatar_id":"","url":"https://api.github.com/users/mg979","html_url":"https://github.com/mg979","followers_url":"https://api.github.com/users/mg979/followers","following_url":"https://api.github.com/users/mg979/following{/other_user}","gists_url":"https://api.github.com/users/mg979/gists{/gist_id}","starred_url":"https://api.github.com/users/mg979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg979/subscriptions","organizations_url":"https://api.github.com/users/mg979/orgs","repos_url":"https://api.github.com/users/mg979/repos","events_url":"https://api.github.com/users/mg979/events{/privacy}","received_events_url":"https://api.github.com/users/mg979/received_events","type":"User","site_admin":false},"repo":{"id":129206982,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkyMDY5ODI=","name":"vim-visual-multi","full_name":"mg979/vim-visual-multi","private":false,"owner":{"login":"mg979","id":26169924,"node_id":"MDQ6VXNlcjI2MTY5OTI0","avatar_url":"https://avatars3.githubusercontent.com/u/26169924?v=4","gravatar_id":"","url":"https://api.github.com/users/mg979","html_url":"https://github.com/mg979","followers_url":"https://api.github.com/users/mg979/followers","following_url":"https://api.github.com/users/mg979/following{/other_user}","gists_url":"https://api.github.com/users/mg979/gists{/gist_id}","starred_url":"https://api.github.com/users/mg979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mg979/subscriptions","organizations_url":"https://api.github.com/users/mg979/orgs","repos_url":"https://api.github.com/users/mg979/repos","events_url":"https://api.github.com/users/mg979/events{/privacy}","received_events_url":"https://api.github.com/users/mg979/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mg979/vim-visual-multi","description":"Multiple cursors project for vim/neovim (wip)","fork":false,"url":"https://api.github.com/repos/mg979/vim-visual-multi","forks_url":"https://api.github.com/repos/mg979/vim-visual-multi/forks","keys_url":"https://api.github.com/repos/mg979/vim-visual-multi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mg979/vim-visual-multi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mg979/vim-visual-multi/teams","hooks_url":"https://api.github.com/repos/mg979/vim-visual-multi/hooks","issue_events_url":"https://api.github.com/repos/mg979/vim-visual-multi/issues/events{/number}","events_url":"https://api.github.com/repos/mg979/vim-visual-multi/events","assignees_url":"https://api.github.com/repos/mg979/vim-visual-multi/assignees{/user}","branches_url":"https://api.github.com/repos/mg979/vim-visual-multi/branches{/branch}","tags_url":"https://api.github.com/repos/mg979/vim-visual-multi/tags","blobs_url":"https://api.github.com/repos/mg979/vim-visual-multi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mg979/vim-visual-multi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mg979/vim-visual-multi/git/refs{/sha}","trees_url":"https://api.github.com/repos/mg979/vim-visual-multi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mg979/vim-visual-multi/statuses/{sha}","languages_url":"https://api.github.com/repos/mg979/vim-visual-multi/languages","stargazers_url":"https://api.github.com/repos/mg979/vim-visual-multi/stargazers","contributors_url":"https://api.github.com/repos/mg979/vim-visual-multi/contributors","subscribers_url":"https://api.github.com/repos/mg979/vim-visual-multi/subscribers","subscription_url":"https://api.github.com/repos/mg979/vim-visual-multi/subscription","commits_url":"https://api.github.com/repos/mg979/vim-visual-multi/commits{/sha}","git_commits_url":"https://api.github.com/repos/mg979/vim-visual-multi/git/commits{/sha}","comments_url":"https://api.github.com/repos/mg979/vim-visual-multi/comments{/number}","issue_comment_url":"https://api.github.com/repos/mg979/vim-visual-multi/issues/comments{/number}","contents_url":"https://api.github.com/repos/mg979/vim-visual-multi/contents/{+path}","compare_url":"https://api.github.com/repos/mg979/vim-visual-multi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mg979/vim-visual-multi/merges","archive_url":"https://api.github.com/repos/mg979/vim-visual-multi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mg979/vim-visual-multi/downloads","issues_url":"https://api.github.com/repos/mg979/vim-visual-multi/issues{/number}","pulls_url":"https://api.github.com/repos/mg979/vim-visual-multi/pulls{/number}","milestones_url":"https://api.github.com/repos/mg979/vim-visual-multi/milestones{/number}","notifications_url":"https://api.github.com/repos/mg979/vim-visual-multi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mg979/vim-visual-multi/labels{/name}","releases_url":"https://api.github.com/repos/mg979/vim-visual-multi/releases{/id}","deployments_url":"https://api.github.com/repos/mg979/vim-visual-multi/deployments","created_at":"2018-04-12T06:55:46Z","updated_at":"2018-12-17T12:53:28Z","pushed_at":"2018-12-18T22:04:10Z","git_url":"git://github.com/mg979/vim-visual-multi.git","ssh_url":"git@github.com:mg979/vim-visual-multi.git","clone_url":"https://github.com/mg979/vim-visual-multi.git","svn_url":"https://github.com/mg979/vim-visual-multi","homepage":"","size":528,"stargazers_count":137,"watchers_count":137,"language":"Vim script","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":8,"watchers":137,"default_branch":"master"}},"base":{"label":"antoinemadec:master","ref":"master","sha":"7dcf8b80ad3960f22e96df1179258fbb6e8ac8e1","user":{"login":"antoinemadec","id":10830594,"node_id":"MDQ6VXNlcjEwODMwNTk0","avatar_url":"https://avatars1.githubusercontent.com/u/10830594?v=4","gravatar_id":"","url":"https://api.github.com/users/antoinemadec","html_url":"https://github.com/antoinemadec","followers_url":"https://api.github.com/users/antoinemadec/followers","following_url":"https://api.github.com/users/antoinemadec/following{/other_user}","gists_url":"https://api.github.com/users/antoinemadec/gists{/gist_id}","starred_url":"https://api.github.com/users/antoinemadec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoinemadec/subscriptions","organizations_url":"https://api.github.com/users/antoinemadec/orgs","repos_url":"https://api.github.com/users/antoinemadec/repos","events_url":"https://api.github.com/users/antoinemadec/events{/privacy}","received_events_url":"https://api.github.com/users/antoinemadec/received_events","type":"User","site_admin":false},"repo":{"id":160433814,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA0MzM4MTQ=","name":"vim-visual-multi","full_name":"antoinemadec/vim-visual-multi","private":false,"owner":{"login":"antoinemadec","id":10830594,"node_id":"MDQ6VXNlcjEwODMwNTk0","avatar_url":"https://avatars1.githubusercontent.com/u/10830594?v=4","gravatar_id":"","url":"https://api.github.com/users/antoinemadec","html_url":"https://github.com/antoinemadec","followers_url":"https://api.github.com/users/antoinemadec/followers","following_url":"https://api.github.com/users/antoinemadec/following{/other_user}","gists_url":"https://api.github.com/users/antoinemadec/gists{/gist_id}","starred_url":"https://api.github.com/users/antoinemadec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoinemadec/subscriptions","organizations_url":"https://api.github.com/users/antoinemadec/orgs","repos_url":"https://api.github.com/users/antoinemadec/repos","events_url":"https://api.github.com/users/antoinemadec/events{/privacy}","received_events_url":"https://api.github.com/users/antoinemadec/received_events","type":"User","site_admin":false},"html_url":"https://github.com/antoinemadec/vim-visual-multi","description":"Multiple cursors project for vim/neovim (wip)","fork":true,"url":"https://api.github.com/repos/antoinemadec/vim-visual-multi","forks_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/forks","keys_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/teams","hooks_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/hooks","issue_events_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/events{/number}","events_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/events","assignees_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/assignees{/user}","branches_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/branches{/branch}","tags_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/tags","blobs_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/git/refs{/sha}","trees_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/statuses/{sha}","languages_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/languages","stargazers_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/stargazers","contributors_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/contributors","subscribers_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/subscribers","subscription_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/subscription","commits_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/commits{/sha}","git_commits_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/git/commits{/sha}","comments_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/comments{/number}","issue_comment_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/comments{/number}","contents_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/contents/{+path}","compare_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/merges","archive_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/downloads","issues_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues{/number}","pulls_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls{/number}","milestones_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/milestones{/number}","notifications_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/labels{/name}","releases_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/releases{/id}","deployments_url":"https://api.github.com/repos/antoinemadec/vim-visual-multi/deployments","created_at":"2018-12-04T23:53:19Z","updated_at":"2018-12-11T00:48:00Z","pushed_at":"2018-12-18T22:07:43Z","git_url":"git://github.com/antoinemadec/vim-visual-multi.git","ssh_url":"git@github.com:antoinemadec/vim-visual-multi.git","clone_url":"https://github.com/antoinemadec/vim-visual-multi.git","svn_url":"https://github.com/antoinemadec/vim-visual-multi","homepage":"","size":511,"stargazers_count":0,"watchers_count":0,"language":"Vim script","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1"},"html":{"href":"https://github.com/antoinemadec/vim-visual-multi/pull/1"},"issue":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/1"},"comments":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/antoinemadec/vim-visual-multi/statuses/ae64fabbd72f61ca37a6e1af431afe5b118eef96"}},"author_association":"NONE"}}
{"actor":{"display_login":"mg979"}}