{"action":"created","comment":{"url":"https://api.github.com/repos/memory-cards/card-types/pulls/comments/245109612","pull_request_review_id":189152987,"id":245109612,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTEwOTYxMg==","diff_hunk":"@@ -1,2 +1,137 @@\n-// @todo: Put valueable logic here\n-console.log('This file should check files structure of card-types.');\n+/* eslint-disable global-require,import/no-dynamic-require */\n+const { lstatSync, readdirSync, writeFileSync } = require('fs');\n+const { join } = require('path');\n+const { tmpdir } = require('os');\n+const AnkiExport = require('anki-apkg-export').default;\n+\n+const OUTPUT_DIR = tmpdir();\n+\n+require('json5/lib/register');\n+\n+const isDirectory = source => lstatSync(source).isDirectory();\n+const getDirectories = source =>\n+  readdirSync(source)\n+    .map(name => join(source, name))\n+    .filter(isDirectory);\n+\n+const currentTypes = getDirectories('./types');\n+\n+const testErrors = {};\n+\n+const containsFile = fileName => typeDir => {\n+  let ret = true;\n+  try {\n+    lstatSync(`./${typeDir}/${fileName}`);\n+  } catch (e) {\n+    console.log(e.message);\n+    ret = false;\n+  }\n+  return ret;\n+};\n+\n+const containsReadme = containsFile('README.md');\n+const containsExample = containsFile('example.json5');\n+const containsValidator = containsFile('validator.js');\n+const containsIndex = containsFile('index.js');\n+\n+const testValidator = typeDir => {\n+  let ret = true;","path":"scripts/testCardTypes.js","position":40,"original_position":40,"commit_id":"c0151b7f9f97543658d6b658fda416b67bdba183","original_commit_id":"c0151b7f9f97543658d6b658fda416b67bdba183","user":{"login":"vvscode","id":6904368,"node_id":"MDQ6VXNlcjY5MDQzNjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6904368?v=4","gravatar_id":"","url":"https://api.github.com/users/vvscode","html_url":"https://github.com/vvscode","followers_url":"https://api.github.com/users/vvscode/followers","following_url":"https://api.github.com/users/vvscode/following{/other_user}","gists_url":"https://api.github.com/users/vvscode/gists{/gist_id}","starred_url":"https://api.github.com/users/vvscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvscode/subscriptions","organizations_url":"https://api.github.com/users/vvscode/orgs","repos_url":"https://api.github.com/users/vvscode/repos","events_url":"https://api.github.com/users/vvscode/events{/privacy}","received_events_url":"https://api.github.com/users/vvscode/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2019-01-03T19:36:42Z","updated_at":"2019-01-03T19:36:42Z","html_url":"https://github.com/memory-cards/card-types/pull/10#discussion_r245109612","pull_request_url":"https://api.github.com/repos/memory-cards/card-types/pulls/10","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/comments/245109612"},"html":{"href":"https://github.com/memory-cards/card-types/pull/10#discussion_r245109612"},"pull_request":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/10"}},"in_reply_to_id":244839445},"pull_request":{"url":"https://api.github.com/repos/memory-cards/card-types/pulls/10","id":241791461,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNzkxNDYx","html_url":"https://github.com/memory-cards/card-types/pull/10","diff_url":"https://github.com/memory-cards/card-types/pull/10.diff","patch_url":"https://github.com/memory-cards/card-types/pull/10.patch","issue_url":"https://api.github.com/repos/memory-cards/card-types/issues/10","number":10,"state":"open","locked":false,"title":"Common type tests","user":{"login":"vvscode","id":6904368,"node_id":"MDQ6VXNlcjY5MDQzNjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6904368?v=4","gravatar_id":"","url":"https://api.github.com/users/vvscode","html_url":"https://github.com/vvscode","followers_url":"https://api.github.com/users/vvscode/followers","following_url":"https://api.github.com/users/vvscode/following{/other_user}","gists_url":"https://api.github.com/users/vvscode/gists{/gist_id}","starred_url":"https://api.github.com/users/vvscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvscode/subscriptions","organizations_url":"https://api.github.com/users/vvscode/orgs","repos_url":"https://api.github.com/users/vvscode/repos","events_url":"https://api.github.com/users/vvscode/events{/privacy}","received_events_url":"https://api.github.com/users/vvscode/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-01-02T16:36:53Z","updated_at":"2019-01-03T19:36:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a892b6295eb2a6e7392941c45f83a46d5300217d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/memory-cards/card-types/pulls/10/commits","review_comments_url":"https://api.github.com/repos/memory-cards/card-types/pulls/10/comments","review_comment_url":"https://api.github.com/repos/memory-cards/card-types/pulls/comments{/number}","comments_url":"https://api.github.com/repos/memory-cards/card-types/issues/10/comments","statuses_url":"https://api.github.com/repos/memory-cards/card-types/statuses/c0151b7f9f97543658d6b658fda416b67bdba183","head":{"label":"memory-cards:common-type-tests","ref":"common-type-tests","sha":"c0151b7f9f97543658d6b658fda416b67bdba183","user":{"login":"memory-cards","id":44524020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NTI0MDIw","avatar_url":"https://avatars2.githubusercontent.com/u/44524020?v=4","gravatar_id":"","url":"https://api.github.com/users/memory-cards","html_url":"https://github.com/memory-cards","followers_url":"https://api.github.com/users/memory-cards/followers","following_url":"https://api.github.com/users/memory-cards/following{/other_user}","gists_url":"https://api.github.com/users/memory-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/memory-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memory-cards/subscriptions","organizations_url":"https://api.github.com/users/memory-cards/orgs","repos_url":"https://api.github.com/users/memory-cards/repos","events_url":"https://api.github.com/users/memory-cards/events{/privacy}","received_events_url":"https://api.github.com/users/memory-cards/received_events","type":"Organization","site_admin":false},"repo":{"id":158402860,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg0MDI4NjA=","name":"card-types","full_name":"memory-cards/card-types","private":false,"owner":{"login":"memory-cards","id":44524020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NTI0MDIw","avatar_url":"https://avatars2.githubusercontent.com/u/44524020?v=4","gravatar_id":"","url":"https://api.github.com/users/memory-cards","html_url":"https://github.com/memory-cards","followers_url":"https://api.github.com/users/memory-cards/followers","following_url":"https://api.github.com/users/memory-cards/following{/other_user}","gists_url":"https://api.github.com/users/memory-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/memory-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memory-cards/subscriptions","organizations_url":"https://api.github.com/users/memory-cards/orgs","repos_url":"https://api.github.com/users/memory-cards/repos","events_url":"https://api.github.com/users/memory-cards/events{/privacy}","received_events_url":"https://api.github.com/users/memory-cards/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/memory-cards/card-types","description":"Contains information/code for different card types","fork":false,"url":"https://api.github.com/repos/memory-cards/card-types","forks_url":"https://api.github.com/repos/memory-cards/card-types/forks","keys_url":"https://api.github.com/repos/memory-cards/card-types/keys{/key_id}","collaborators_url":"https://api.github.com/repos/memory-cards/card-types/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/memory-cards/card-types/teams","hooks_url":"https://api.github.com/repos/memory-cards/card-types/hooks","issue_events_url":"https://api.github.com/repos/memory-cards/card-types/issues/events{/number}","events_url":"https://api.github.com/repos/memory-cards/card-types/events","assignees_url":"https://api.github.com/repos/memory-cards/card-types/assignees{/user}","branches_url":"https://api.github.com/repos/memory-cards/card-types/branches{/branch}","tags_url":"https://api.github.com/repos/memory-cards/card-types/tags","blobs_url":"https://api.github.com/repos/memory-cards/card-types/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/memory-cards/card-types/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/memory-cards/card-types/git/refs{/sha}","trees_url":"https://api.github.com/repos/memory-cards/card-types/git/trees{/sha}","statuses_url":"https://api.github.com/repos/memory-cards/card-types/statuses/{sha}","languages_url":"https://api.github.com/repos/memory-cards/card-types/languages","stargazers_url":"https://api.github.com/repos/memory-cards/card-types/stargazers","contributors_url":"https://api.github.com/repos/memory-cards/card-types/contributors","subscribers_url":"https://api.github.com/repos/memory-cards/card-types/subscribers","subscription_url":"https://api.github.com/repos/memory-cards/card-types/subscription","commits_url":"https://api.github.com/repos/memory-cards/card-types/commits{/sha}","git_commits_url":"https://api.github.com/repos/memory-cards/card-types/git/commits{/sha}","comments_url":"https://api.github.com/repos/memory-cards/card-types/comments{/number}","issue_comment_url":"https://api.github.com/repos/memory-cards/card-types/issues/comments{/number}","contents_url":"https://api.github.com/repos/memory-cards/card-types/contents/{+path}","compare_url":"https://api.github.com/repos/memory-cards/card-types/compare/{base}...{head}","merges_url":"https://api.github.com/repos/memory-cards/card-types/merges","archive_url":"https://api.github.com/repos/memory-cards/card-types/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/memory-cards/card-types/downloads","issues_url":"https://api.github.com/repos/memory-cards/card-types/issues{/number}","pulls_url":"https://api.github.com/repos/memory-cards/card-types/pulls{/number}","milestones_url":"https://api.github.com/repos/memory-cards/card-types/milestones{/number}","notifications_url":"https://api.github.com/repos/memory-cards/card-types/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/memory-cards/card-types/labels{/name}","releases_url":"https://api.github.com/repos/memory-cards/card-types/releases{/id}","deployments_url":"https://api.github.com/repos/memory-cards/card-types/deployments","created_at":"2018-11-20T14:33:17Z","updated_at":"2018-12-31T15:10:51Z","pushed_at":"2019-01-02T16:36:53Z","git_url":"git://github.com/memory-cards/card-types.git","ssh_url":"git@github.com:memory-cards/card-types.git","clone_url":"https://github.com/memory-cards/card-types.git","svn_url":"https://github.com/memory-cards/card-types","homepage":null,"size":17115,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"memory-cards:master","ref":"master","sha":"a26ab9baf79db87180470aea10e987b2b9c76e46","user":{"login":"memory-cards","id":44524020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NTI0MDIw","avatar_url":"https://avatars2.githubusercontent.com/u/44524020?v=4","gravatar_id":"","url":"https://api.github.com/users/memory-cards","html_url":"https://github.com/memory-cards","followers_url":"https://api.github.com/users/memory-cards/followers","following_url":"https://api.github.com/users/memory-cards/following{/other_user}","gists_url":"https://api.github.com/users/memory-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/memory-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memory-cards/subscriptions","organizations_url":"https://api.github.com/users/memory-cards/orgs","repos_url":"https://api.github.com/users/memory-cards/repos","events_url":"https://api.github.com/users/memory-cards/events{/privacy}","received_events_url":"https://api.github.com/users/memory-cards/received_events","type":"Organization","site_admin":false},"repo":{"id":158402860,"node_id":"MDEwOlJlcG9zaXRvcnkxNTg0MDI4NjA=","name":"card-types","full_name":"memory-cards/card-types","private":false,"owner":{"login":"memory-cards","id":44524020,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NTI0MDIw","avatar_url":"https://avatars2.githubusercontent.com/u/44524020?v=4","gravatar_id":"","url":"https://api.github.com/users/memory-cards","html_url":"https://github.com/memory-cards","followers_url":"https://api.github.com/users/memory-cards/followers","following_url":"https://api.github.com/users/memory-cards/following{/other_user}","gists_url":"https://api.github.com/users/memory-cards/gists{/gist_id}","starred_url":"https://api.github.com/users/memory-cards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/memory-cards/subscriptions","organizations_url":"https://api.github.com/users/memory-cards/orgs","repos_url":"https://api.github.com/users/memory-cards/repos","events_url":"https://api.github.com/users/memory-cards/events{/privacy}","received_events_url":"https://api.github.com/users/memory-cards/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/memory-cards/card-types","description":"Contains information/code for different card types","fork":false,"url":"https://api.github.com/repos/memory-cards/card-types","forks_url":"https://api.github.com/repos/memory-cards/card-types/forks","keys_url":"https://api.github.com/repos/memory-cards/card-types/keys{/key_id}","collaborators_url":"https://api.github.com/repos/memory-cards/card-types/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/memory-cards/card-types/teams","hooks_url":"https://api.github.com/repos/memory-cards/card-types/hooks","issue_events_url":"https://api.github.com/repos/memory-cards/card-types/issues/events{/number}","events_url":"https://api.github.com/repos/memory-cards/card-types/events","assignees_url":"https://api.github.com/repos/memory-cards/card-types/assignees{/user}","branches_url":"https://api.github.com/repos/memory-cards/card-types/branches{/branch}","tags_url":"https://api.github.com/repos/memory-cards/card-types/tags","blobs_url":"https://api.github.com/repos/memory-cards/card-types/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/memory-cards/card-types/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/memory-cards/card-types/git/refs{/sha}","trees_url":"https://api.github.com/repos/memory-cards/card-types/git/trees{/sha}","statuses_url":"https://api.github.com/repos/memory-cards/card-types/statuses/{sha}","languages_url":"https://api.github.com/repos/memory-cards/card-types/languages","stargazers_url":"https://api.github.com/repos/memory-cards/card-types/stargazers","contributors_url":"https://api.github.com/repos/memory-cards/card-types/contributors","subscribers_url":"https://api.github.com/repos/memory-cards/card-types/subscribers","subscription_url":"https://api.github.com/repos/memory-cards/card-types/subscription","commits_url":"https://api.github.com/repos/memory-cards/card-types/commits{/sha}","git_commits_url":"https://api.github.com/repos/memory-cards/card-types/git/commits{/sha}","comments_url":"https://api.github.com/repos/memory-cards/card-types/comments{/number}","issue_comment_url":"https://api.github.com/repos/memory-cards/card-types/issues/comments{/number}","contents_url":"https://api.github.com/repos/memory-cards/card-types/contents/{+path}","compare_url":"https://api.github.com/repos/memory-cards/card-types/compare/{base}...{head}","merges_url":"https://api.github.com/repos/memory-cards/card-types/merges","archive_url":"https://api.github.com/repos/memory-cards/card-types/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/memory-cards/card-types/downloads","issues_url":"https://api.github.com/repos/memory-cards/card-types/issues{/number}","pulls_url":"https://api.github.com/repos/memory-cards/card-types/pulls{/number}","milestones_url":"https://api.github.com/repos/memory-cards/card-types/milestones{/number}","notifications_url":"https://api.github.com/repos/memory-cards/card-types/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/memory-cards/card-types/labels{/name}","releases_url":"https://api.github.com/repos/memory-cards/card-types/releases{/id}","deployments_url":"https://api.github.com/repos/memory-cards/card-types/deployments","created_at":"2018-11-20T14:33:17Z","updated_at":"2018-12-31T15:10:51Z","pushed_at":"2019-01-02T16:36:53Z","git_url":"git://github.com/memory-cards/card-types.git","ssh_url":"git@github.com:memory-cards/card-types.git","clone_url":"https://github.com/memory-cards/card-types.git","svn_url":"https://github.com/memory-cards/card-types","homepage":null,"size":17115,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/10"},"html":{"href":"https://github.com/memory-cards/card-types/pull/10"},"issue":{"href":"https://api.github.com/repos/memory-cards/card-types/issues/10"},"comments":{"href":"https://api.github.com/repos/memory-cards/card-types/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/memory-cards/card-types/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/memory-cards/card-types/statuses/c0151b7f9f97543658d6b658fda416b67bdba183"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vvscode"}}