{"action":"created","comment":{"url":"https://api.github.com/repos/josefs/Gradualizer/pulls/comments/237191845","pull_request_review_id":179413887,"id":237191845,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzE5MTg0NQ==","diff_hunk":"@@ -83,23 +80,500 @@ type_check_dir(Dir, Opts) ->\n     end.\n \n %% @doc Type check a source or beam file\n-%% (Option `print_file' is implicitely true)\n--spec type_check_files([file:filename()]) -> ok | nok.\n+-spec type_check_files([file:filename()]) -> [{file:filename(), [typechecker:type_error()]}].\n type_check_files(Files) ->\n     type_check_files(Files, []).\n \n %% @doc Type check a source or beam\n-%% (Option `print_file' is implicitely true)\n--spec type_check_files([file:filename()], options()) -> ok | nok.\n+-spec type_check_files([file:filename()], typechecker:options()) -> [{file:filename(), [typechecker:type_error()]}].\n type_check_files(Files, Opts) ->\n     StopOnFirstError = proplists:get_bool(stop_on_first_error, Opts),\n     lists:foldl(\n-        fun(File, Res) when Res =:= ok;\n+        fun(File, Errors) when Errors =:= [];\n                             not StopOnFirstError ->\n-                case type_check_file(File, [print_file|Opts]) of\n-                    ok -> Res;\n-                    nok -> nok\n+                case type_check_file(File, Opts) of\n+                    [] -> Errors;\n+                    NewErrors -> [{File, NewErrors} | Errors]\n                 end;\n-            (_, nok) ->\n-                nok\n-        end, ok, Files).\n+            (_, Errors) ->\n+                Errors\n+        end, [], Files).\n+\n+-spec format_error(typechecker:type_error()) -> string().","path":"src/gradualizer.erl","position":112,"original_position":112,"commit_id":"acc185422bcbad413e856111c68b4d1743a865f9","original_commit_id":"acc185422bcbad413e856111c68b4d1743a865f9","user":{"login":"zuiderkwast","id":273886,"node_id":"MDQ6VXNlcjI3Mzg4Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/273886?v=4","gravatar_id":"","url":"https://api.github.com/users/zuiderkwast","html_url":"https://github.com/zuiderkwast","followers_url":"https://api.github.com/users/zuiderkwast/followers","following_url":"https://api.github.com/users/zuiderkwast/following{/other_user}","gists_url":"https://api.github.com/users/zuiderkwast/gists{/gist_id}","starred_url":"https://api.github.com/users/zuiderkwast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuiderkwast/subscriptions","organizations_url":"https://api.github.com/users/zuiderkwast/orgs","repos_url":"https://api.github.com/users/zuiderkwast/repos","events_url":"https://api.github.com/users/zuiderkwast/events{/privacy}","received_events_url":"https://api.github.com/users/zuiderkwast/received_events","type":"User","site_admin":false},"body":"`io_lib:format` doesn't return a string() but rather an iolist(), a nested list of strings.","created_at":"2018-11-28T17:45:54Z","updated_at":"2018-11-28T17:59:23Z","html_url":"https://github.com/josefs/Gradualizer/pull/59#discussion_r237191845","pull_request_url":"https://api.github.com/repos/josefs/Gradualizer/pulls/59","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/comments/237191845"},"html":{"href":"https://github.com/josefs/Gradualizer/pull/59#discussion_r237191845"},"pull_request":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/josefs/Gradualizer/pulls/59","id":226382319,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzgyMzE5","html_url":"https://github.com/josefs/Gradualizer/pull/59","diff_url":"https://github.com/josefs/Gradualizer/pull/59.diff","patch_url":"https://github.com/josefs/Gradualizer/pull/59.patch","issue_url":"https://api.github.com/repos/josefs/Gradualizer/issues/59","number":59,"state":"open","locked":false,"title":"Unify error terms","user":{"login":"Zalastax","id":908496,"node_id":"MDQ6VXNlcjkwODQ5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/908496?v=4","gravatar_id":"","url":"https://api.github.com/users/Zalastax","html_url":"https://github.com/Zalastax","followers_url":"https://api.github.com/users/Zalastax/followers","following_url":"https://api.github.com/users/Zalastax/following{/other_user}","gists_url":"https://api.github.com/users/Zalastax/gists{/gist_id}","starred_url":"https://api.github.com/users/Zalastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zalastax/subscriptions","organizations_url":"https://api.github.com/users/Zalastax/orgs","repos_url":"https://api.github.com/users/Zalastax/repos","events_url":"https://api.github.com/users/Zalastax/events{/privacy}","received_events_url":"https://api.github.com/users/Zalastax/received_events","type":"User","site_admin":false},"body":"See #49.\r\n\r\nThis work turned out more tedious than I expected but the codebase was fortunately already structured so that this could be done without intrusive changes.\r\n\r\nThere's still no documentation, I'd like `type_error()` to have a tight type, and I'd like to get rid of `handle_type_error` by changing what is thrown so I'm leaving #49 open - I will unassign myself from it though.\r\n\r\nThe different reasons are fairly ad-hoc - it would be nice if someone thinks of a good way to group them and that they document that.\r\nSome error messages are / were quite cryptic so check that I didn't misinterpret any. It would be nice to unify error messages as well (especially when a newline should be used and where to print the line number).\r\n","created_at":"2018-10-28T17:14:32Z","updated_at":"2018-11-28T17:59:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"358376664b6e32100fba3c78d94402c4115dd06d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/josefs/Gradualizer/pulls/59/commits","review_comments_url":"https://api.github.com/repos/josefs/Gradualizer/pulls/59/comments","review_comment_url":"https://api.github.com/repos/josefs/Gradualizer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/josefs/Gradualizer/issues/59/comments","statuses_url":"https://api.github.com/repos/josefs/Gradualizer/statuses/acc185422bcbad413e856111c68b4d1743a865f9","head":{"label":"Zalastax:errors-as-data","ref":"errors-as-data","sha":"acc185422bcbad413e856111c68b4d1743a865f9","user":{"login":"Zalastax","id":908496,"node_id":"MDQ6VXNlcjkwODQ5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/908496?v=4","gravatar_id":"","url":"https://api.github.com/users/Zalastax","html_url":"https://github.com/Zalastax","followers_url":"https://api.github.com/users/Zalastax/followers","following_url":"https://api.github.com/users/Zalastax/following{/other_user}","gists_url":"https://api.github.com/users/Zalastax/gists{/gist_id}","starred_url":"https://api.github.com/users/Zalastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zalastax/subscriptions","organizations_url":"https://api.github.com/users/Zalastax/orgs","repos_url":"https://api.github.com/users/Zalastax/repos","events_url":"https://api.github.com/users/Zalastax/events{/privacy}","received_events_url":"https://api.github.com/users/Zalastax/received_events","type":"User","site_admin":false},"repo":{"id":149652141,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk2NTIxNDE=","name":"Gradualizer","full_name":"Zalastax/Gradualizer","private":false,"owner":{"login":"Zalastax","id":908496,"node_id":"MDQ6VXNlcjkwODQ5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/908496?v=4","gravatar_id":"","url":"https://api.github.com/users/Zalastax","html_url":"https://github.com/Zalastax","followers_url":"https://api.github.com/users/Zalastax/followers","following_url":"https://api.github.com/users/Zalastax/following{/other_user}","gists_url":"https://api.github.com/users/Zalastax/gists{/gist_id}","starred_url":"https://api.github.com/users/Zalastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zalastax/subscriptions","organizations_url":"https://api.github.com/users/Zalastax/orgs","repos_url":"https://api.github.com/users/Zalastax/repos","events_url":"https://api.github.com/users/Zalastax/events{/privacy}","received_events_url":"https://api.github.com/users/Zalastax/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Zalastax/Gradualizer","description":null,"fork":true,"url":"https://api.github.com/repos/Zalastax/Gradualizer","forks_url":"https://api.github.com/repos/Zalastax/Gradualizer/forks","keys_url":"https://api.github.com/repos/Zalastax/Gradualizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zalastax/Gradualizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zalastax/Gradualizer/teams","hooks_url":"https://api.github.com/repos/Zalastax/Gradualizer/hooks","issue_events_url":"https://api.github.com/repos/Zalastax/Gradualizer/issues/events{/number}","events_url":"https://api.github.com/repos/Zalastax/Gradualizer/events","assignees_url":"https://api.github.com/repos/Zalastax/Gradualizer/assignees{/user}","branches_url":"https://api.github.com/repos/Zalastax/Gradualizer/branches{/branch}","tags_url":"https://api.github.com/repos/Zalastax/Gradualizer/tags","blobs_url":"https://api.github.com/repos/Zalastax/Gradualizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zalastax/Gradualizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zalastax/Gradualizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zalastax/Gradualizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zalastax/Gradualizer/statuses/{sha}","languages_url":"https://api.github.com/repos/Zalastax/Gradualizer/languages","stargazers_url":"https://api.github.com/repos/Zalastax/Gradualizer/stargazers","contributors_url":"https://api.github.com/repos/Zalastax/Gradualizer/contributors","subscribers_url":"https://api.github.com/repos/Zalastax/Gradualizer/subscribers","subscription_url":"https://api.github.com/repos/Zalastax/Gradualizer/subscription","commits_url":"https://api.github.com/repos/Zalastax/Gradualizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zalastax/Gradualizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zalastax/Gradualizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zalastax/Gradualizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zalastax/Gradualizer/contents/{+path}","compare_url":"https://api.github.com/repos/Zalastax/Gradualizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zalastax/Gradualizer/merges","archive_url":"https://api.github.com/repos/Zalastax/Gradualizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zalastax/Gradualizer/downloads","issues_url":"https://api.github.com/repos/Zalastax/Gradualizer/issues{/number}","pulls_url":"https://api.github.com/repos/Zalastax/Gradualizer/pulls{/number}","milestones_url":"https://api.github.com/repos/Zalastax/Gradualizer/milestones{/number}","notifications_url":"https://api.github.com/repos/Zalastax/Gradualizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zalastax/Gradualizer/labels{/name}","releases_url":"https://api.github.com/repos/Zalastax/Gradualizer/releases{/id}","deployments_url":"https://api.github.com/repos/Zalastax/Gradualizer/deployments","created_at":"2018-09-20T18:21:39Z","updated_at":"2018-11-06T22:37:26Z","pushed_at":"2018-11-27T01:29:09Z","git_url":"git://github.com/Zalastax/Gradualizer.git","ssh_url":"git@github.com:Zalastax/Gradualizer.git","clone_url":"https://github.com/Zalastax/Gradualizer.git","svn_url":"https://github.com/Zalastax/Gradualizer","homepage":null,"size":599,"stargazers_count":0,"watchers_count":0,"language":"Erlang","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":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"josefs:master","ref":"master","sha":"22143d93d02d1251bfa06aa114f23580fed090f6","user":{"login":"josefs","id":152020,"node_id":"MDQ6VXNlcjE1MjAyMA==","avatar_url":"https://avatars0.githubusercontent.com/u/152020?v=4","gravatar_id":"","url":"https://api.github.com/users/josefs","html_url":"https://github.com/josefs","followers_url":"https://api.github.com/users/josefs/followers","following_url":"https://api.github.com/users/josefs/following{/other_user}","gists_url":"https://api.github.com/users/josefs/gists{/gist_id}","starred_url":"https://api.github.com/users/josefs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefs/subscriptions","organizations_url":"https://api.github.com/users/josefs/orgs","repos_url":"https://api.github.com/users/josefs/repos","events_url":"https://api.github.com/users/josefs/events{/privacy}","received_events_url":"https://api.github.com/users/josefs/received_events","type":"User","site_admin":false},"repo":{"id":108764455,"node_id":"MDEwOlJlcG9zaXRvcnkxMDg3NjQ0NTU=","name":"Gradualizer","full_name":"josefs/Gradualizer","private":false,"owner":{"login":"josefs","id":152020,"node_id":"MDQ6VXNlcjE1MjAyMA==","avatar_url":"https://avatars0.githubusercontent.com/u/152020?v=4","gravatar_id":"","url":"https://api.github.com/users/josefs","html_url":"https://github.com/josefs","followers_url":"https://api.github.com/users/josefs/followers","following_url":"https://api.github.com/users/josefs/following{/other_user}","gists_url":"https://api.github.com/users/josefs/gists{/gist_id}","starred_url":"https://api.github.com/users/josefs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josefs/subscriptions","organizations_url":"https://api.github.com/users/josefs/orgs","repos_url":"https://api.github.com/users/josefs/repos","events_url":"https://api.github.com/users/josefs/events{/privacy}","received_events_url":"https://api.github.com/users/josefs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/josefs/Gradualizer","description":null,"fork":false,"url":"https://api.github.com/repos/josefs/Gradualizer","forks_url":"https://api.github.com/repos/josefs/Gradualizer/forks","keys_url":"https://api.github.com/repos/josefs/Gradualizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josefs/Gradualizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josefs/Gradualizer/teams","hooks_url":"https://api.github.com/repos/josefs/Gradualizer/hooks","issue_events_url":"https://api.github.com/repos/josefs/Gradualizer/issues/events{/number}","events_url":"https://api.github.com/repos/josefs/Gradualizer/events","assignees_url":"https://api.github.com/repos/josefs/Gradualizer/assignees{/user}","branches_url":"https://api.github.com/repos/josefs/Gradualizer/branches{/branch}","tags_url":"https://api.github.com/repos/josefs/Gradualizer/tags","blobs_url":"https://api.github.com/repos/josefs/Gradualizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josefs/Gradualizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josefs/Gradualizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/josefs/Gradualizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josefs/Gradualizer/statuses/{sha}","languages_url":"https://api.github.com/repos/josefs/Gradualizer/languages","stargazers_url":"https://api.github.com/repos/josefs/Gradualizer/stargazers","contributors_url":"https://api.github.com/repos/josefs/Gradualizer/contributors","subscribers_url":"https://api.github.com/repos/josefs/Gradualizer/subscribers","subscription_url":"https://api.github.com/repos/josefs/Gradualizer/subscription","commits_url":"https://api.github.com/repos/josefs/Gradualizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/josefs/Gradualizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/josefs/Gradualizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/josefs/Gradualizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/josefs/Gradualizer/contents/{+path}","compare_url":"https://api.github.com/repos/josefs/Gradualizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josefs/Gradualizer/merges","archive_url":"https://api.github.com/repos/josefs/Gradualizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josefs/Gradualizer/downloads","issues_url":"https://api.github.com/repos/josefs/Gradualizer/issues{/number}","pulls_url":"https://api.github.com/repos/josefs/Gradualizer/pulls{/number}","milestones_url":"https://api.github.com/repos/josefs/Gradualizer/milestones{/number}","notifications_url":"https://api.github.com/repos/josefs/Gradualizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josefs/Gradualizer/labels{/name}","releases_url":"https://api.github.com/repos/josefs/Gradualizer/releases{/id}","deployments_url":"https://api.github.com/repos/josefs/Gradualizer/deployments","created_at":"2017-10-29T19:30:20Z","updated_at":"2018-11-27T20:07:07Z","pushed_at":"2018-11-27T20:07:09Z","git_url":"git://github.com/josefs/Gradualizer.git","ssh_url":"git@github.com:josefs/Gradualizer.git","clone_url":"https://github.com/josefs/Gradualizer.git","svn_url":"https://github.com/josefs/Gradualizer","homepage":null,"size":607,"stargazers_count":124,"watchers_count":124,"language":"Erlang","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":26,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/59"},"html":{"href":"https://github.com/josefs/Gradualizer/pull/59"},"issue":{"href":"https://api.github.com/repos/josefs/Gradualizer/issues/59"},"comments":{"href":"https://api.github.com/repos/josefs/Gradualizer/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/josefs/Gradualizer/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/josefs/Gradualizer/statuses/acc185422bcbad413e856111c68b4d1743a865f9"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"zuiderkwast"}}