Add typespecs#11
Open
Annopaolo wants to merge 2 commits into
Open
Conversation
rbino
suggested changes
Mar 12, 2021
| defp process_response({:error, _} = response), do: response | ||
| defp process_response({:ok, %HTTPoison.Response{body: body}}), do: extract_result(body) | ||
|
|
||
| @spec extract_result(iodata) :: {:error, any} | {:ok, any} |
Contributor
There was a problem hiding this comment.
Swap :ok and :error clauses for consistency
| @scan_opts [:ip, :timeout, :family, :scanner] | ||
| @sign_opts [:hosts, :subject, :serial_sequence, :label, :profile, :bundle] | ||
|
|
||
| @spec authsign(CFXXL.Client.t(), String.t(), String.t(), keyword) :: {:ok, any} | {:error, any} |
Contributor
There was a problem hiding this comment.
General style guideline: we always use parentheses after types in typespecs, so: keyword(), any() and so on, please fix it everywhere
|
|
||
| def certinfo(_client, _opts), do: {:error, :no_certificate_or_domain} | ||
|
|
||
| @spec crl(CFXXL.Client.t(), any) :: {:ok, any} | {:error, any} |
Contributor
There was a problem hiding this comment.
Try to be specific with input arguments when you can deduce more specific types from the contex and/or from the doc. For example here you could use:
@spec crl(CFXXL.Client.t(), String.t() | nil) :: {:ok, any} | {:error, any}
Signed-off-by: Arnaldo Cesco <arnaldo.cesco@ispirata.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Include and extend #10.