Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#68] Fixed bug when elvis.config is missing from the repo. #69

Merged
merged 1 commit into from
Jul 31, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/elvis_github.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ pull_req_comments(Cred, Repo, PR) ->
Comments = jiffy:decode(Result, [return_maps]),
{ok, Comments}.

-spec file_content(credentials(), repository(), string(), string()) ->
{ok, binary()}.
-spec file_content(credentials(), repository(), string(), string()) -> result().
file_content(Cred, Repo, CommitId, Filename) ->
Url = make_url(file_content, {Repo, CommitId, Filename}),
case auth_req(Cred, Url) of
Expand All @@ -95,7 +94,7 @@ file_content(Cred, Repo, CommitId, Filename) ->
Content = base64:decode(ContentBase64),
{ok, Content};
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec user(credentials()) -> result().
Expand All @@ -106,7 +105,7 @@ user(Cred) ->
JsonResult = jiffy:decode(Result, [return_maps]),
{ok, JsonResult};
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec repos(credentials(), string()) -> result().
Expand All @@ -129,7 +128,7 @@ hooks(Cred, Repo) ->
JsonResult = jiffy:decode(Result, [return_maps]),
{ok, JsonResult};
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec create_webhook(credentials(), repository(), string(), [string()]) -> result().
Expand All @@ -147,7 +146,7 @@ create_webhook(Cred, Repo, WebhookUrl, Events) ->
JsonResult = jiffy:decode(Result, [return_maps]),
{ok, JsonResult};
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec delete_webhook(credentials(), repository(), string()) -> result().
Expand All @@ -159,7 +158,7 @@ delete_webhook(Cred, Repo, Id) ->
{ok, _Result} ->
ok;
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec collaborators(credentials(), repository()) -> result().
Expand All @@ -170,7 +169,7 @@ collaborators(Cred, Repo) ->
JsonResult = jiffy:decode(Result, [return_maps]),
{ok, JsonResult};
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec add_collaborator(credentials(), repository(), string()) -> result().
Expand All @@ -181,7 +180,7 @@ add_collaborator(Cred, Repo, Collaborator) ->
{ok, _Result} ->
ok;
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

-spec remove_collaborator(credentials(), repository(), string()) -> result().
Expand All @@ -192,7 +191,7 @@ remove_collaborator(Cred, Repo, Collaborator) ->
{ok, _Result} ->
ok;
{error, Reason} ->
throw(Reason)
{error, Reason}
end.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down