{"action":"created","comment":{"url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/comments/57507216","id":57507216,"diff_hunk":"@@ -0,0 +1,32 @@\n+import chalk from 'chalk'\n+\n+/**\n+ * @param {Array<Object>} messages: An array of message objects.\n+ * @returns {String} A colored string representation of the given message objects.\n+ */\n+export default function formatMessagesAsString(messages) {\n+  // Return undefined when there are no messages to format\n+  if (!messages.length) {\n+    return undefined\n+  }\n+\n+  return messages.reduce(messageReducer, '')\n+\n+  function messageReducer(accumulatorString, messageObject, index, array) {\n+    // Don't append newline to the last entry\n+    const newline = index === array.length - 1 ? '\\n' : ''\n+\n+    const formattedMessage = formatMessage(messageObject)\n+    return `${accumulatorString}${newline}${formattedMessage}\\n`\n+  }\n+}","path":"src/formatMessagesAsString/index.js","position":22,"original_position":22,"commit_id":"240f5c596690303e506c7046bf728d91d77ceeb0","original_commit_id":"240f5c596690303e506c7046bf728d91d77ceeb0","user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"body":"I started using `reduce` for things a few months ago and I totally love it. It's crazy powerful [example from yesterday](https://github.com/kentcdodds/webpack-validator/blob/65111bb9c80fd5e9771ad9ec14bf02dd116275c5/src/validators/stats/index.js#L24-L29). I found [these lessons](https://egghead.io/series/reduce-data-with-javascript) are reeeally good.","created_at":"2016-03-26T01:58:15Z","updated_at":"2016-03-26T01:58:15Z","html_url":"https://github.com/kentcdodds/configuration-validator/pull/16#discussion_r57507216","pull_request_url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/comments/57507216"},"html":{"href":"https://github.com/kentcdodds/configuration-validator/pull/16#discussion_r57507216"},"pull_request":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16","id":64162897,"html_url":"https://github.com/kentcdodds/configuration-validator/pull/16","diff_url":"https://github.com/kentcdodds/configuration-validator/pull/16.diff","patch_url":"https://github.com/kentcdodds/configuration-validator/pull/16.patch","issue_url":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/16","number":16,"state":"open","locked":false,"title":"API Change","user":{"login":"jonathanewerner","id":3755413,"avatar_url":"https://avatars.githubusercontent.com/u/3755413?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanewerner","html_url":"https://github.com/jonathanewerner","followers_url":"https://api.github.com/users/jonathanewerner/followers","following_url":"https://api.github.com/users/jonathanewerner/following{/other_user}","gists_url":"https://api.github.com/users/jonathanewerner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanewerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanewerner/subscriptions","organizations_url":"https://api.github.com/users/jonathanewerner/orgs","repos_url":"https://api.github.com/users/jonathanewerner/repos","events_url":"https://api.github.com/users/jonathanewerner/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanewerner/received_events","type":"User","site_admin":false},"body":"This implements changes discussed in #15, with a small modification: i thought it'd be nice to slim down the API surface by not exposing `uncoveredFields` directly, but instead just handle them under regular `warnings`. I don't see much value in treating them special and handling of this API will be easier for consumers. Thoughts?\r\n","created_at":"2016-03-25T13:40:15Z","updated_at":"2016-03-26T01:58:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0d81d26f07d74f3aeeac1abb549274427909383","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16/commits","review_comments_url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16/comments","review_comment_url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/16/comments","statuses_url":"https://api.github.com/repos/kentcdodds/configuration-validator/statuses/240f5c596690303e506c7046bf728d91d77ceeb0","head":{"label":"jonathanewerner:pr/api-change","ref":"pr/api-change","sha":"240f5c596690303e506c7046bf728d91d77ceeb0","user":{"login":"jonathanewerner","id":3755413,"avatar_url":"https://avatars.githubusercontent.com/u/3755413?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanewerner","html_url":"https://github.com/jonathanewerner","followers_url":"https://api.github.com/users/jonathanewerner/followers","following_url":"https://api.github.com/users/jonathanewerner/following{/other_user}","gists_url":"https://api.github.com/users/jonathanewerner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanewerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanewerner/subscriptions","organizations_url":"https://api.github.com/users/jonathanewerner/orgs","repos_url":"https://api.github.com/users/jonathanewerner/repos","events_url":"https://api.github.com/users/jonathanewerner/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanewerner/received_events","type":"User","site_admin":false},"repo":{"id":54714280,"name":"configuration-validator","full_name":"jonathanewerner/configuration-validator","owner":{"login":"jonathanewerner","id":3755413,"avatar_url":"https://avatars.githubusercontent.com/u/3755413?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanewerner","html_url":"https://github.com/jonathanewerner","followers_url":"https://api.github.com/users/jonathanewerner/followers","following_url":"https://api.github.com/users/jonathanewerner/following{/other_user}","gists_url":"https://api.github.com/users/jonathanewerner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanewerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanewerner/subscriptions","organizations_url":"https://api.github.com/users/jonathanewerner/orgs","repos_url":"https://api.github.com/users/jonathanewerner/repos","events_url":"https://api.github.com/users/jonathanewerner/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanewerner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonathanewerner/configuration-validator","description":"A pluggable configuration validator","fork":true,"url":"https://api.github.com/repos/jonathanewerner/configuration-validator","forks_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/forks","keys_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/teams","hooks_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/hooks","issue_events_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/issues/events{/number}","events_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/events","assignees_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/assignees{/user}","branches_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/branches{/branch}","tags_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/tags","blobs_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/languages","stargazers_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/stargazers","contributors_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/contributors","subscribers_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/subscribers","subscription_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/subscription","commits_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/contents/{+path}","compare_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/merges","archive_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/downloads","issues_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/issues{/number}","pulls_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/labels{/name}","releases_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/releases{/id}","deployments_url":"https://api.github.com/repos/jonathanewerner/configuration-validator/deployments","created_at":"2016-03-25T11:16:30Z","updated_at":"2016-03-25T11:16:31Z","pushed_at":"2016-03-25T13:36:08Z","git_url":"git://github.com/jonathanewerner/configuration-validator.git","ssh_url":"git@github.com:jonathanewerner/configuration-validator.git","clone_url":"https://github.com/jonathanewerner/configuration-validator.git","svn_url":"https://github.com/jonathanewerner/configuration-validator","homepage":"","size":32,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"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":"master"}},"base":{"label":"kentcdodds:master","ref":"master","sha":"624288fac5f6fbb11fff35d174f15eabbca2977e","user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"repo":{"id":51812231,"name":"configuration-validator","full_name":"kentcdodds/configuration-validator","owner":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kentcdodds/configuration-validator","description":"A pluggable configuration validator","fork":false,"url":"https://api.github.com/repos/kentcdodds/configuration-validator","forks_url":"https://api.github.com/repos/kentcdodds/configuration-validator/forks","keys_url":"https://api.github.com/repos/kentcdodds/configuration-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kentcdodds/configuration-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kentcdodds/configuration-validator/teams","hooks_url":"https://api.github.com/repos/kentcdodds/configuration-validator/hooks","issue_events_url":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/events{/number}","events_url":"https://api.github.com/repos/kentcdodds/configuration-validator/events","assignees_url":"https://api.github.com/repos/kentcdodds/configuration-validator/assignees{/user}","branches_url":"https://api.github.com/repos/kentcdodds/configuration-validator/branches{/branch}","tags_url":"https://api.github.com/repos/kentcdodds/configuration-validator/tags","blobs_url":"https://api.github.com/repos/kentcdodds/configuration-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kentcdodds/configuration-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kentcdodds/configuration-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/kentcdodds/configuration-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kentcdodds/configuration-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/kentcdodds/configuration-validator/languages","stargazers_url":"https://api.github.com/repos/kentcdodds/configuration-validator/stargazers","contributors_url":"https://api.github.com/repos/kentcdodds/configuration-validator/contributors","subscribers_url":"https://api.github.com/repos/kentcdodds/configuration-validator/subscribers","subscription_url":"https://api.github.com/repos/kentcdodds/configuration-validator/subscription","commits_url":"https://api.github.com/repos/kentcdodds/configuration-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/kentcdodds/configuration-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/kentcdodds/configuration-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/kentcdodds/configuration-validator/contents/{+path}","compare_url":"https://api.github.com/repos/kentcdodds/configuration-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kentcdodds/configuration-validator/merges","archive_url":"https://api.github.com/repos/kentcdodds/configuration-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kentcdodds/configuration-validator/downloads","issues_url":"https://api.github.com/repos/kentcdodds/configuration-validator/issues{/number}","pulls_url":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/kentcdodds/configuration-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/kentcdodds/configuration-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kentcdodds/configuration-validator/labels{/name}","releases_url":"https://api.github.com/repos/kentcdodds/configuration-validator/releases{/id}","deployments_url":"https://api.github.com/repos/kentcdodds/configuration-validator/deployments","created_at":"2016-02-16T06:05:54Z","updated_at":"2016-03-21T03:37:10Z","pushed_at":"2016-03-25T13:40:15Z","git_url":"git://github.com/kentcdodds/configuration-validator.git","ssh_url":"git@github.com:kentcdodds/configuration-validator.git","clone_url":"https://github.com/kentcdodds/configuration-validator.git","svn_url":"https://github.com/kentcdodds/configuration-validator","homepage":"","size":35,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16"},"html":{"href":"https://github.com/kentcdodds/configuration-validator/pull/16"},"issue":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/16"},"comments":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/kentcdodds/configuration-validator/statuses/240f5c596690303e506c7046bf728d91d77ceeb0"}}}}